Blog

  • 13 Manfaat Kopi si Minuman Ajaib (Seribu Jenis Antioksidan)

    Selama berabad-abad, kopi menjadi minuman yang dipuja sekaligus dicela. Penelitian mengenai manfaat kopi mungkin sama banyaknya dengan bukti-bukti tentang efek buruknya. Kontroversi ini timbul karena begitu banyak zat yang dikandung dalam secangkir kopi.

    Kandungan utama yang paling dikenal dari kopi adalah kafein. Namun, dampak yang ditimbulkannya terhadap tubuh bukan hanya disebabkan kafein, melainkan juga zat-zat lainnya. Untuk tahu lebih jelas kegunaan kopi dan efeknya bagi tubuh, simak uraian berikut ini.

    Kandungan Nutrisi Kopi dan Waktu yang Tepat Meminumnya

    Menurut sejarahnya, kopi pertama kali diminum oleh bangsa Yaman dalam sebuah upacara keagamaan. Namun, tanaman kopi saat ini sudah dibudidayakan di lebih dari 70 negara di dunia, termasuk Indonesia. Jenis yang paling banyak ditanam adalah kopi arabika dan robusta.

    Meskipun kandungan vitamin dan mineralnya sangat sedikit, kopi tidak mengandung gula maupun karbohidrat. Selain kafein, kopi juga mengandung kalori, protein, riboflavin, pantothenic acid, kalium, mangan, magnesium, dan niasin.

    Fakta lain akan kehebatan kopi adalah bahwa biji kopi mengandung lebih dari 1.000 macam antioksidan. Selain mengatasi peradangan dam menetralkan radikal bebas, antioksidan utama dalam kopi, chromogenic acid, terbukti mampu mencegah penyakit kardiovaskuler.

    Lalu, kapan waktu terbaik untuk minum kopi? Ternyata, minum kopi di pagi hari tidak disarankan karena akan terjadi “tabrakan” antara hormon kortisol dengan kafein. Keduanya sama-sama berfungsi meningkatkan kewaspadaan sehingga manfaat kopi menjadi tidak efektif.

    Kopi disarankan untuk diminum antara pukul 09.30–11.30 pagi agar manfaat kopi lebih terasa. Pada jam-jam tersebut, hormon kortisol berada pada level terendah. Minum kopi akan menggantikan kortisol dalam mengembalikan tingkat kewaspadaan.

    Manfaat Kopi untuk Kesehatan

    Banyak yang berpendapat bahwa minum kopi akan menyebabkan peningkatan detak jantung dan tekanan darah, serta insomnia.

    Namun, penelitian-penelitian terbaru membuktikan bahwa di balik rasanya yang pahit, kopi memiliki banyak manfaat untuk kesehatan, yaitu sebagai berikut.

    Mempertajam Memori Jangka Pendek

    Kafein dalam kopi baik bagi otak karena memengaruhi area otak yang bertanggung jawab untuk konsentrasi dan memori jangka pendek. Dengan minum kopi setiap hari, kemampuan otak untuk berkonsentrasi dan mengingat peristiwa akan meningkat.

    Mengurangi Risiko Alzheimer dan Demensia

    Minum 3-5 cangkir kopi sehari dipercaya akan menurunkan risiko demensia dan Alzheimer hingga 65%. Hal ini disebabkan kopi mencegah pembentukan plak beta-amyloid dan menurunkan gula darah yang merupakan pemicu terjadinya Alzheimer dan demensia.

    Mencegah Beberapa Jenis Kanker

    Polifenol di dalam kopi merupakan antioksidan yang bersifat antikarsinogen. Bagi pria, minum kopi setiap hari akan mencegah kanker prostat, dan bagi wanita, kopi dapat mencegah kanker endometrium. Minum kopi juga terbukti mencegah kanker payudara, usus, dan hati.

    Mencegah Diabetes

    Minum kopi tanpa gula terbukti menurunkan risiko diabetes sebesar 7%. Selain meningkatkan efektivitas insulin, kopi mencegah kerusakan jaringan dan mengurangi penumpukan zat-zat racun seperti amyloid fibril yang ditemukan pada penderita diabetes.

    Baik untuk Jantung

    Anda mungkin sering mendengar bahwa minum kopi berbahaya untuk jantung. Namun, sebuah penelitian yang melibatkan 37.000 orang menunjukkan konsumsi kopi dengan dosis sedang bisa menurunkan 20% risiko terjadinya penyakit jantung.

    Menjaga Kesehatan Hati

    Kopi mampu menurunkan risiko kanker dan sirosis hati hingga 20%. Studi yang dilakukan di Turki menunjukkan, kopi akan menurunkan produksi enzim hati yang merupakan indikator terjadinya kerusakan pada hati.

    Meringankan Depresi

    Menurut para ahli saraf, kopi dapat mengaktifkan neurotransmitter sehingga mood Anda menjadi lebih baik. Yang termasuk dalam transmitter adalah hormon serotonin dan dopamin yang membuat perasaan menjadi lebih gembira.

    Manfaat Kopi untuk Kecantikan

    Selain memberikan manfaat dari dalam tubuh, pemakaian kopi untuk perawatan dari luar juga punya manfaat menakjubkan untuk kecantikan. Bagaimana cara memanfaatkan kopi untuk merawat kecantikan? Ini dia ulasannya.

    Mengangkat Sel Kulit Mati

    Kopi giling tidak larut dalam air sehingga cocok digunakan sebagai eksfolian untuk wajah dan tubuh. Caranya, campurkan bubuk kopi atau ampas kopi baru dengan gula dan minyak zaitun, lalu gosokkan ke permukaan kulit. Diamkan selama beberapa menit, lalu bilas hingga bersih.

    Merevitalisasi Kulit

    Selain kopi hitam, Anda juga bisa menggunakan kopi hijau untuk merevitalisasai kulit. Caranya, campurkan 3 sendok teh kopi hijau, 1 sendok teh susu, dan air secukupnya sampai menjadi pasta. Gunakan sebagai masker, biarkan hingga kering, lalu bilas air dengan dingin.

    Melenyapkan Mata Panda

    Untuk melenyapkan mata panda, aplikasikan bubuk kopi yang sudah sedikit dibasahi di sekitar mata. Kafein dalam kopi akan merangsang darah mengalir ke area mata sehingga kulit di sekeliling mata kembali kencang dan antioksidannya melindungi dari pengaruh sinar UV.

    Mengobati Jerawat

    Ada tiga senyawa penting yang membuat manfaat kopi sangat efektif untuk mengatasi jerawat, yaitu antioksidan, stimulan, dan chlorogenic acid. Scrub dari kopi akan membersihkan sel kulit mati yang menyumbat pori dan chlorogenic acid mencegah peradangan.

    Merawat Kaki

    Bubuk kopi juga bisa digunakan sebagai scrub untuk kaki sehingga bersih dan halus. Kandungan kafein pada kopi akan memperlancar sirkulasi darah ke kaki. Untuk menggunakannya, lakukan cara berikut.

    • Seduh satu gelas besar kopi
    • Tuang kopi bersama ampasnya ke dalam ember kecil.
    • Setelah kopi dingin, rendam kaki sambil digosok perlahan.
    • Bilas dengan air bersih, keringkan, dan gunakan lotion.

    Menghitamkan Rambut

    Warna hitam pada kopi bisa digunakan untuk menghitamkan rambut. Buatlah seduhan kopi kental, tunggu hingga dingin. Aplikasikan ke seluruh rambut, diamkan selama 30 menit–3 jam, lalu bilas. Anda juga bisa mencampurnya dengan minyak zaitun sebagai masker rambut.

    Banyak studi menunjukkan, Anda akan mendapatkan manfaat kopi secara maksimal jika minum 1-2 cangkir kopi setiap hari. Akan lebih baik lagi jika Anda menggiling sendiri biji kopinya dan segera menyeduh serta meminumnya saat itu juga. Selamat ngopi!

  • Speeding Up Arduino

    Introduction

    For many of us, we started out programming on desktops and servers, which seemed to have infinite memory and processing power (well, depending on when you started programming, I guess). There was little reason to optimize your code since you weren’t likely to exceed the system’s limits anyway. And then, when you got in to embedded systems, there was the rude awakening. Moving from such a powerful system to a much smaller, less capable one, like an Arduino, was a bit of a shock. All of a sudden you had to think about saving CPU cycles and memory, which doesn’t always come easy to programmers just starting out.

    As you’ll see throughout this article, fast code is not only important for doing calculations, but even more so for IO operations. If you venture in to robotics (like drones or other control systems) this will become even more clear since much of the work done by the microcontroller results in IO. Usually a faster feedback loop meant better performance.

    After a few weeks of wrangling with a microcontroller to squeeze out every ounce of processing power as possible for a drone flight controller, I thought I’d write up an article to help you find ways to improve the speed and efficiency of your own projects.

    Throughout this article, I’ll be focusing on the Arduino Uno since that seems to be the most common board out there, although much of this article should also apply to the other boards as well.

    Why Arduinos are Slow

    Clock Speed

    First of all, you are only as fast as your clock (disregarding multi-core processors), which the Arduino Uno defaults to using a 16Mhz crystal. What that means is the ATmega microcontroller can execute up to 16 million instructions per second. Now, 16 million instructions per second may sound like a lot (and it is, sort of), but when you consider what all an Arduino needs to do to execute even simple operations, it really isn’t that much. For many projects, the clock cycles are shared between things like calculations, I2C communication, reading and writing to pins and registers, and many more operations.

    Even then, seemingly simple commands can take up quite a bit of clock cycles, such as setting a digital pin to high. This is one of the simplest IO operations you can perform on an Arduino, but it actually takes a very long time (over 50 clock cycles!) because of the amount of code used in the digitalWrite() method, which I’ll address in the next section. So a faster clock would allow you to execute the instructions at a faster pace.

    Safety Checks and Validation

    So, outside of the clock speed, why are Arduinos slow? Well, it mostly has to do with some of the standard method calls and objects we use throughout our code. Here are just a few of the main culprits:

    • digitalWrite()
    • digitalRead()
    • pinMode()

    Many of these methods suffer from the same drawbacks, so let’s take a look at the code for one of the most commonly used methods, digitalWrite():

    void digitalWrite(uint8_t pin, uint8_t val)
    {
        uint8_t timer = digitalPinToTimer(pin);
        uint8_t bit = digitalPinToBitMask(pin);
        uint8_t port = digitalPinToPort(pin);
        volatile uint8_t *out;
    
        if (port == NOT_A_PIN) return;
    
        // If the pin that support PWM output, we need to turn it off
        // before doing a digital write.
        if (timer != NOT_ON_TIMER) turnOffPWM(timer);
    
        out = portOutputRegister(port);
    
        uint8_t oldSREG = SREG;
        cli();
    
        if (val == LOW) {
            *out &= ~bit;
        } else {
            *out |= bit;
        }
    
        SREG = oldSREG;
    }

    As you can see, there is quite a bit going on here. But shouldn’t it be much simpler? All we really need to do is set the pin high or low in a register, right? Turns out that the Arduino creators decided it was more important to add safety checks and validation to the code than it was to make the code fast. After all, this is a platform targeted more towards beginners and education than it is to power users and CPU-intensive applications.

    The first few lines use the pin parameter to find the corresponding timer, bit, and port for the given pin. The port is actually just a memory-mapped register, which controls multiple pins. To only turn on or off the pin we want, we need to determine which bit of the register our pin corresponds to, which is what the digitalPinToBitMask() function does.

    Once we’ve found the timer, bit, and port, we check to make sure it is in fact a valid pin. This line isn’t required for digitalWrite() to do its job, but it acts as a safety net for more inexperienced programmers (and even experienced ones). We’d hate to be writing to the wrong memory location and corrupt the program.

    The if (timer != NOT_ON_TIMER) … line is there to make sure we end any previous PWM usage of the pin before we write a “constant” high or low. Many of the pins on Arduinos can also be used for PWM output, which requires a timer to operate by timing the duty cycles. If needed, this line will turn off the PWM. So again, to ensure we don’t see any weird behavior, this is a safety check meant to help the user.

    And finally, in the last few lines we’re actually setting the given value to the given port.

    The safety checks do slow down the execution quite a bit, but it also makes debugging much easier. This way when something goes wrong, you’re less likely to get weird behavior that will leave you scratching your head. There is nothing more frustrating to have seemingly logical code and to not get the expected result. Programming microcontrollers is much different than programming desktop or phone apps (although they have their fair share of difficulties too). Since you’re working directly with hardware and don’t have an operating system to keep you safe, problems can be hard to find.

    If speed isn’t your goal, then I’d highly recommend you continue to use these method provided by Arduino. There is no point in exposing yourself to unnecessary risk if it doesn’t help you reach your end goal.

    You should also know that the method calls aren’t always slow because of the amount of code it executes, but a contributing factor could be because of the physical limitations of the device. For example, analogRead() takes about 100 microseconds per call due to the resolution it provides and clock it’s supplied. A lower ADC resolutions would decrease the time each call takes. However, even then, while the hardware is ultimately the limiting factor here, the Arduino code does conservatively set the ADC max sample rate to only 9600Hz (while capable of around 77Khz). So, while Arduinos are much slower than they need to be, it isn’t always because of design choices and trade-offs. There is a good discussion about this here, and documentation here.

    How to Speed up Arduino

    To be clear, we aren’t actually making Arduino faster, rather, we’re making the code more efficient. I point out this distinction because using these tricks won’t give us a faster clock (although we can speed up the clock, which I’ll touch on later), it will just execute less code. This is an important distinction because having a faster clock provides us other benefits, like having more precise timers, faster communication, etc.

    Also, keep in mind that by using the code below you’re making some trade-offs. The programmers who developed Arduino weren’t just lousy coders who couldn’t write fast code, they consciously made the decision to add validations and safety checks to methods like digitalWrite() since it benefits their target customers. Just make sure you understand what can (and will) go wrong with these kinds of trade-offs.

    Anyway, on to the code.

    Digital Write

    Now, I’m not going to show you how to speed up every method, but many of the same concepts from here can be applied to other methods like pinMode(). The minimum amount of code you need to write to a pin is:

    define CLR(x,y) (x&=(~(1<<y)))
    define SET(x,y) (x|=(1<<y))

    Yup, that’s it.

    As you can see, we get right to the point in these macros. To use them, you’ll have to reference both the port and bit position directly instead of conveniently using the pin numbers. For example, we’d be using the macro like this:

    SET(PORTB, 0);

    This would end up writing a HIGH value to pin 8 on your Arduino Uno. It’s a little bit rough, but much faster. This also means we’re more prone to doing something wrong, like reference a non-existent port, write over an active PWM, or a number of other things.

    The macro gives us quite a boost, using up an estimated 2 cycles (8Mhz frequency), whereas digitalWrite() uses up a whopping 56 cycles (285Khz frequency).

    Serial

    Unfortunately for some tasks, like if you need to use serial communication, there isn’t a whole lot you can do to improve the speed, but there are some optimization you can watch out for.

    Serial communication is commonly used for sending debugging or status information to the desktop IDE, which means you probably have Serial.println() statements all throughout your code. It’s easy to forget about these statements after development, so if you’re looking for a speed boost and don’t need to debug anymore, try removing all the println() calls and removing Serial from the code altogether. Just having it initialized (and not even using Serial.println()) means you’re wasting a lot of cycles in the TX and RX interrupts. In one case, it was measured that just having Serial enabled slowed down the digitalWrite()s by about 18%. That’s a lot of wasted cycles due to dead code.

    Clock Speed

    Although I’ve mostly focused on the software improvements you can make, don’t forget that there is always the “simple” improvement of speeding up the clock. I say it this way because it isn’t really a simple plug-and-play improvement after all. In order to speed up the clock on an Arduino, you need to insert a new crystal in to the board, which may or may not be difficult depending on your soldering skills.

    Once you’ve put in a new crystal oscillator, you still need to update the bootloader to reflect the change, otherwise it won’t be able to receive code over the serial port. And lastly, you’ll need to change the F_CPU value to the proper clock speed. If you upped the clock to 20Mhz (the fastest clock the ATmega is rated for), for example, then you’ll need to modify a few files in the Arduino IDE:

    • In preferences.txt, change
      • from: build.f_cpu=16000000L
      • to: build.f_cpu=20000000L
    • In the makefile, change
      • from: F_CPU = 16000000
      • to: F_CPU = 20000000

    According to this post, the ATmega328 can be overclocked to 30Mhz, but I don’t recommend it =)

    Conclusion

    Hopefully you found something in this post that you can easily apply to your projects, or at least I’m hoping it will encourage you to browse the Arduino source code to find optimizations of your own. The Arduino is a very capable microcontroller, but it can be capable of so much more.

    Have any optimizations of your own you’d like to share? Let us know in the comments!

    Source: https://stackabuse.com/speeding-up-arduino/

  • 12 Jenis Bahan Satin dan Tips Memilih Busana Satin yang Tepat!

    12 Jenis Bahan Satin dan Tips Memilih Busana Satin yang Tepat!

    Kain satin adalah salah satu jenis produk tekstil yang sangat populer di Indonesia. Berbagai macam busana maupun aksesori dari bahan satin bisa dijumpai dengan mudah di mana saja, dari yang murah meriah hingga yang super mahal.

    Mengapa harganya bisa sangat bervariasi? Jawabannya, karena satin memiliki banyak jenis dengan kualitas yang berbeda pula. Tulisan ini akan mengulas jenis-jenis satin yang ada di Indonesia, ciri-cirinya, dan cara memilih kain satin yang tepat.

    Karakteristik dan Kelebihan Satin

    Bahan Satin Duchesse

    Tenun satin berasal dari Kota Zayton atau Zaitun di Cina, yang kemudian diekspor ke berbagai belahan dunia. Pada mulanya, satin hanya dibuat dari benang sutra. Keindahan kain ini membuat Italia melakukan impor besar-besaran selama abad ke-12 dan ke-13.

    Penggunaan benang sutra dan penenunan secara tradisional membuat kain satin menjadi sangat mahal. Di Italia, bahan satin hanya dikenakan oleh kalangan bangsawan.

    Namun, berkat penemuan alat tenun listrik pada masa revolusi industri, kain satin bisa diproduksi secara massal dan lebih murah.

    Kain satin memiliki kemiripan dengan sutra, tetapi dibuat dari serat yang berbeda. Satin ditenun dengan serat buatan, seperti poliester, sedangkan sutra dibuat dari serat alami. Hasilnya, kedua sisi kain sutra bersifat licin dan glossy, sedangkan kain satin hanya pada salah satu sisinya.

    Bahan satin memiliki banyak kelebihan, terutama jika dibuat menjadi pakaian.

    • Permukaan yang mengilap membuat busana dari satin terlihat glamor, mewah, dan feminin.
    • Saat menyentuh kulit, permukaan satin terasa halus dan lembut sehingga nyaman saat dikenakan.
    • Saat ini, kain satin diproduksi dengan beragam jenis sehingga Anda bisa memilih yang paling sesuai dengan gaya yang ingin ditampilkan dan tentu saja bujet.

    Cara merawat kain satin relatif kurang lebih sama dengan cara merawat bahan wollycrepe. Selalu cuci busana satin dengan tangan, gunakan air dingin dan detergen lembut.

    Pakaian satin cukup dikeringkan dengan cara diangin-anginkan dan saat menyetrika, gunakan suhu yang tidak terlalu panas.

    Jenis-Jenis yang Bagus

    Bahan Satin Untuk Sandal

    Mengetahui beberapa jenis kain satin akan membuat Anda lebih bijak sebelum memutuskan untuk membelinya, berikut diantaranya:

    Satin Duchesse (Satin Bridal)

    Kain ini disebut satin duchesse (bangsawan) karena sering digunakan untuk membuat gaun pengantin mewah layaknya seorang bangsawan. Sifat bahan ini agak berat dan kaku.

    Satin Faconne (Satin Jacquard)

    Memiliki berat dan kualitas bervariasi, kain ini lebih lembut dibanding duchesse. Biasanya, satin faconne memiliki motif, seperti garis-garis, paisley, atau lainnya.

    Satin Slipper

    Stin slipper sering digunakan untuk membuat sepatu balet. Ciri khasnya adalah kainnya cukup unik dan bisa dicelup.

    Satin Delustered

    Berbeda dari jenis lainnya, satin delustered atau peau de soie tidak berkilau dan memiliki tekstur yang ringan.

    Satin Damask

    Keunggulan kain ini adalah adanya pola-pola rumit nan indah, selain karena dibuat dari sutra dan memiliki pola timbul dari bahan velvet.

    Satin Cloth

    Karena diproses dari wol Perancis yang ditenun dengan teknik satin, kain ini disebut juga satin de laine atau “satin wol”. Bahannya kuat, awet, dan bercahaya.

    Sateen

    Satin berbeda dengan sateen. Satin menggunakan serat filamen seperti sutra, sedangkan sateen menggunakan serat katun atau shord-stap. Namun, keduanya ditenun dengan teknik yang sama.

    Satin Kahatex

    Karena sifatnya sedikit kaku dan tebal, satin kahatex lebih tepat digunakan untuk dekorasi furnitur, hiasan, atau aksesori.

    Satin Clarisa

    Kain ini sangat laku karena harganya murah. Dengan karakter tipis dan tidak kaku, satin clarisa digunakan untuk berbagai macam keperluan.

    Satin Silk (Satin Sutra)

    Berharga relatif murah, kain ini sangat lembut, tipis, dan dingin. Warna-warninya pun sangat beragam dan biasanya berjenis doff.

    Satin Velvet (Double Satin)

    Karena dibuat dari kombinasi bahan-bahan kaos, satin velvet dua kali lebih tebal dari satin biasa dengan karakter jatuh dan berat.

    Satin Roberto Cavali

    Inilah jenis satin yang paling mahal dan dibuat dari dua bahan, yaitu satin silk dan double hycon. Selain jatuh, tebal, dan menyerap keringat, dua sisi kain ini memiliki warna sejenis, tetapi sedikit berbeda.

    Tips Memilih Baju Satin

    Jika Anda ingin tampil menarik dan elegan, busana dari satin, baik gaun, blus, maupun gamis, adalah pilihan yang paling tepat.

    Namun, dengan begitu banyaknya jenis pakaian yang ada di pasaran, Anda perlu berhati-hati agar tidak mendapatkan produk berkualitas rendah, apalagi palsu.

    Berikut adalah beberapa hal yang wajib Anda teliti sebelum membeli baju satin.

    Permukaan Kain

    Ciri khas satin adalah satu sisi permukaannya licin, mengilap, dan tidak mudah kusut. Jadi, saat memilih busana, cek permukaan kain, apakah memiliki ciri seperti itu, karena tak jarang ada penjual yang mengatakan bahwa baju tersebut berbahan satin, padahal bukan.

    Kualitas Tenunan

    Satin dibuat dengan cara ditenun sehingga helaian seratnya rentan terlepas dan terurai. Hal ini tentunya akan membuat pakaian Anda mudah rusak. Karena itu, telitilah apakah ada helaian yang terlepas pada busana yang hendak dibeli.

    Kekuatan Jahitan

    Kekuatan jahitan harus menjadi perhatian utama saat memilih pakaian, terlebih lagi pada busana yang dibuat dari kain hasil tenun seperti satin. Pastikan seluruh jahitan rapi dan kuat agar pakaian lebih tahan lama.

    Kenyamanan

    Ada baiknya Anda mencoba memakai baju yang hendak dibeli dan rasakan saat kain menempel di kulit. Seperti halnya bahan monalisa, kain satin asli akan terasa nyaman, tidak panas, dan halus saat dipakai.

    Memilih jenis kain dari sebuah produk pakaian memang harus dilakukan dengan cermat agar tidak menyesal karena membeli busana berkualitas rendah.

    Mengetahui jenis-jenis bahan satin membantu Anda memilih dengan tepat sehingga tidak hanya bisa tampil “wah”, tetapi juga nyaman.

    Sumber: https://notepam.com/bahan-satin/

  • Bahan Taiga: Populer Karena Dipakai Louis Vuitton, Mau Tau?

    Bahan Taiga: Populer Karena Dipakai Louis Vuitton, Mau Tau?

    Anda pasti kenal Louis Vuitton (LV). Brand fashion favorit sosialita dan selebriti papan atas dunia ini begitu populer lewat produk-produk tasnya. Bukan hanya tas Speedy, produk terpopuler mereka, tetapi juga bahan taiga yang banyak ditiru produsen aksesori dunia.

    Jajaran produk taiga khusus diperuntukkan bagi pria. LV menggunakan bahan tersebut dalam produksi koper dan berbagai aksesori travelling lainnya. Contohnya, seperti tas jinjing, tas slempang, dompet, sepatu, sabuk, dan aksesori pria lainnya.

    Apa Itu Taiga?

    Sebenarnya Taiga adalah nama sebuah hutan yang berada di wilayah Siberia Timur, Rusia. Daerah tersebut dikenal ekstrem dengan suhu dingin yang membekukan. Temperatur selama musim dingin bisa mencapai minus 62 derajat Celsius.

    Sementara, kulit taiga merupakan jenis kulit semisintetik dari kulit sapi pilihan. LV meluncurkan lini produk Taiga Leather pada 1993 dan popularitasnya masih bertahan sampai sekarang. Bahkan varian kulit ini pun diadopsi oleh banyak produsen aksesori lainnya di dunia.

    Kulit taiga yang beredar di Indonesia memiliki karakteristik hampir serupa dengan kepunyaan LV, tetapi dengan kualitas berada di bawahnya. Ibaratnya seperti pada bahan wolfis premium dan standar, di mana kulit taiga dari Louis Vuitton adalah premiumnya.

    Jika bahan balotelly dibuat menggunakan campuran antara serat alami dan buatan, taiga terbuat dari campuran polivinil klorida (PVC) atau poliuretan (PU) dan diolah sedemikian rupa agar mirip dengan kulit asli.

    Cirinya lembut dan cukup lentur, mudah diwarnai, awet, serta memiliki daya tahan terhadap panas tinggi sehingga tak mudah leleh.

    Kulit sintetik dari polimer ini mempunyai karakter berbeda di kedua sisinya. Permukaan luarnya bertekstur kasar, bergaris-garis atau tampak seperti serat-serat halus yang menonjol, dan mengilap.

    Sementara di sisi dalamnya padat, seperti serat-serat untuk membuat bahan twiscone, dan cenderung lebih halus.

    Sifatnya yang kokoh dan tidak mudah menyerap air membuat kulit sintetik taiga banyak dipakai dalam pembuatan tas. Saat ini, bukan hanya LV yang memiliki lini produk taiga, tetapi juga produsen-produsen tas dan spesialis kulit lainnya di dunia, termasuk di Indonesia.

    Jika dibandingkan dengan taiga asli milik Louis Vuitton, harga bahan taiga yang banyak beredar di pasaran lokal berada jauh di bawahnya. Sebut saja salah satu varian tas LV, Taiga Leather Moskova Briefcase RI0052, yang dibanderol sekitar $995 atau hampir Rp 14 jutaan.

    Sedangkan di sini, kulit taiga berkualitas A berkisar mulai Rp 35 ribuan saja per yar (91 cm). Sementara, untuk produk tas lokal dari taiga asli paling mahal hanya dibanderol di angka sekitar Rp 4 jutaan. Benar-benar selisih harga yang cukup fantastis, bukan?

    Membuat Tas dari Taiga

    Untuk membuat tas dari bahan taiga ada beberapa tahap yang mesti Anda lakukan, berikut diantaranya:

    Persiapan

    Pertama-tama siapkan peralatan dan bahannya. Anda akan membutuhkan bahan taiga dan flanel sesuai ukuran tas yang diinginkan, misalnya 100×50 cm untuk masing-masing bahan tersebut.

    Anda perlu mempersiapkan juga bahan untuk tali tas. Bisa dengan memakai dua potong kulit taiga berukuran 4×25 cm, atau jenis tali lain yang biasa dijual sebagai sparepart tas. Lalu, mata ayam berdiameter maksimal 1 cm dan tang keling untuk memasangnya.

    Terakhir, siapkan peralatan menjahit, seperti mesin jahit, jarum pentul dan jarum khusus untuk kulit, serta benang. Jangan lupakan penggaris dan kapur jahit untuk menandai pola, serta gunting untuk memotong bahan yang digunakan.

    Menjahit Bahan

    Lipat kulit taiga dan kain flanel tadi menjadi ukuran 50×50 cm, lalu lekatkan keduanya dengan jarum pentul, masih dalam bentuk lipatan. Kain flanel berfungsi sebagai pelapis bagian dalam tas agar lebih lembut saat disentuh.

    Anda akan mendapatkan kantung kulit berlapis flanel yang tampak di bagian dalamnya. Kemudian jahitlah sisi kanan dan kirinya, meninggalkan satu lubang di bagian atas agar kantung tersebut mulai dapat berfungsi. Pastikan jahitan menutup kuat kedua sisinya.

    Membuat Tali Tas

    Potongan kulit taiga dilipat mengikuti lebarnya. Jadi, Anda akan mendapatkan bentuk lipatan dengan ukuran 2×25 cm. Jahit memanjang pada sisi di mana ujung kain saling bertemu, untuk membuat tali tas yang cukup tebal dan kuat.

    Pasang mata ayam di lokasi yang dinginkan untuk menempatkan tali. Biasanya, berada di sekitar lubang kantung tas, beberapa sentimeter di bawah pucuk tas. Pastikan posisinya benar-benar presisi, gunakan kapur dan penggaris untuk menentukan letaknya secara tepat.

    Kemudian, selundupkan ujung-ujung tali tas ke dalam lubang mata ayam yang telah Anda pasang tadi. Masukkan dari sisi luar, lalu kunci dengan membuat simpul mati pada setiap ujungnya agar tali tidak mudah copot. Tas taiga simpel siap Anda pakai bepergian.

    Langkah-langkah di atas masih bisa Anda aplikasikan meski tanpa menggunakan kulit taiga. Ada banyak material kain yang bisa Anda pakai untuk membuat kerajinan tas sendiri di rumah. Bisa kanvas, katun, atau bahkan bahan linen, tergantung kebutuhan dan kreativitas Anda.

    Tips Perawatan Tas dari Kulit Taiga

    Apa artinya punya barang bagus jika tak bisa merawatnya dengan baik? Meski taiga terkenal dengan keawetannya, material ini juga mudah rusak jika dipakai serampangan dan dirawat apa adanya.

    Perawatan kulit sintetik tergolong gampang. Jika tas Anda kotor, bersihkan hanya dengan menggunakan kain lembut, tanpa perlu detergen atau zat keras penghilang noda lainnya. Sebagai penggantinya, gunakan air hangat bercampur sabun bayi untuk noda membandel.

    Anda dapat menjaga tas dengan bahan taiga kw agar berumur lebih lama. Sehabis dipakai seharian, istirahatkan selama 1–2 hari sebelum menggunakannya lagi.

    Lindungi permukaannya dengan lapisan silikon wax dan simpanlah di tempat tersendiri, terpisah dari tas dengan bahan taiga asli. Dengan demikian, Anda dapat menggunakan tas-tas tersebut dalam jangka waktu yang lama.

  • Bahan Polyester: 6 Fakta Menarik Mengapa Banyak Orang Menjualnya

    Bahan Polyester: 6 Fakta Menarik Mengapa Banyak Orang Menjualnya

    Tentu Anda sudah sangat sering mendengar tentang bahan polyester. Ya, bahan ini seolah ada di mana-mana dan bisa didapatkan dengan mudah. Yang tidak banyak orang sadari adalah bahan ini sebenarnya ada hampir di seluruh barang berkain di sekitar.

    Bahan polyester bisa dipakai untuk membuat apa saja, mulai dari baju, celana, rok, selimut, sofa, bahkan tirai jendela sekalipun. Polyester bukanlah merupakan bahan yang diproduksi secara alamiah. Lalu, dengan cara apa?

    Proses dan Makna Polyester

    Polyester dibuat melalui proses kimiawi yang dilakukan oleh manusia. Polyester sendiri berasal dari dua kata, yakni polimer yang berarti plastik dan ester yang berarti campuran antara asam karboksilat, alkohol, serta minyak bumi.

    Karena bisa dibuat dengan proses kimiawi, kain polyester ini sangat mudah untuk diproduksi dan tentu saja hal ini memengaruhi harganya. Harga polyester sangatlah terjangkau dan bahannya pun tidak langka alias mudah ditemukan.

    Jenis-Jenis

    Seperti bahan jersey, ada beberapa tipe polyester yang beredar di pasaran.

    PET

    Tipe PET atau polietilena tereftalat merupakan polyester yang paling banyak digunakan sebagai bahan utama pakaian, bahan dasar botol air, bahan dasar minuman bersoda, serta botol-botol plastik lainnya.

    Supaya PET bisa menjadi kain, ia harus divakum dalam ruangan hampa yang bersuhu tinggi. Proses ini cukup rumit dan hanya bisa dilakukan oleh pabrik-pabrik besar.

    PCDT

    PCDT (poly-1,4-cyclohexylene-dimethylene). Bahan yang satu ini memiliki struktur yang lebih elastis apabila dibandingkan dengan PET. PCDT sering digunakan sebagai bahan dasar untuk taplak, tirai jendela, atau untuk karpet tipis.

    Filamen

    Benang filamen dapat diproses menjadi kain polyester yang unik. Kain polyester dengan bahan filamen ini adalah kain yang seolah terlihat seperti berasal dari bahan yang alami, sehingga terasa lembut.

    Kelebihan

    Ada beberapa kelebihan kain polyester bila dibandingkan dengan kain lainnya, seperti bahan crepe, misalnya. Berikut adalah beberapa kelebihan dari kain polyester yang bisa menguntungkan Anda.

    • Terjangkau dan mudah ditemukan. Lantaran terbuat dari bahan kimia, beragam pabrik bisa memproduksi kain ini dengan mudah. Jadi, keberadaan kain ini jelas tidak langka dan bisa ditemukan di mana saja, sama seperti bahan polycotton.
    • Tahan lama. Bahan kimia sebagai material-material dasar pembuat polyester menjadikan bahan yang satu ini lebih tahan lama dan awet apabila dibandingkan dengan kain-kain lain yang murni terbuat dari kapas. Jadi, meskipun Anda mencucinya berkali-kali dan menggunakannya dalam jangka waktu lama, baju dengan bahan dasar polyester tidak akan mudah rusak.
    • Tidak gampang berkerut. Kelebihan lain dari kain polyester adalah tidak mudah berkerut dan juga tidak mudah kusut seperti bahan crepe. Jadi, Anda tak perlu ragu atau bingung saat akan menyimpan kain ini di dalam lemari. Proses penyetrikaan kain ini pun juga mudah. Dengan menggunakan suhu sedang, maka kain polyester pun bisa menjadi halus dalam waktu yang cepat.
    • Cepat kering. Anda tidak perlu menunggu kain polyester kering dalam waktu lama. Pasalnya, kain yang satu ini amat cepat kering dan cenderung tahan air. Maka dari itu, selain bahan spandek, bahan baju renang pun juga menggunakan polyester.

    Kekurangan

    Polyester juga memiliki beberapa kekurangan. Beberapa kekurangan polyester antara lain sebagai berikut.

    • Mudah terbakar. Lantaran bahan-bahan dasar dari polyester adalah plastik, maka sudah tentu kain ini akan mudah sekali tersulut api. Maka dari itu, baju-baju berbahan polyester sebaiknya dijauhkan dari api dan bahan-bahan lain yang mudah terbakar.
    • Panas. Polyester adalah bahan yang mudah yang panas dan juga tidak memiliki sirkulasi udara yang bagus. Pori-porinya kecil dan juga tidak menyerap keringat.

    Jadi, ketika menggunakan pakaian yang berbahan dasar polyester, Anda akan merasa lebih panas. Baju berbahan polyester memang sebaiknya dikenakan di ruangan yang tidak pengap.

    Perawatan

    Secara umum, polyester tidak membutuhkan perawatan rumit. Maklum, karena dibuat melalui proses kimia, polyester bukanlah bahan yang mudah rusak dan juga usang. Proses perawatan baju polyester adalah sebagai berikut.

    • Pertama, cuci busana, baik secara manual maupun dengan mesin. Keduanya sama-sama tidak akan merusak polyester.
    • Kedua, gunakan detergen standar yang bisa Anda temukan di supermarket terdekat. Kain polyester tidak rentan terhadap jenis detergen tertentu dan mudah untuk beradaptasi.
    • Yang ketiga, gunakan panas sedang saat menyetrika baju polyester. Ya, baju polyester mudah terbakar sehingga sebaiknya tidak menggunakan suhu tinggi di mesin setrika.
    • Dan yang terakhir, lipatlah polyester dengan cara biasa, bahan ini tidak mudah kusut. Meski begitu, jangan menyimpannya dengan asal-asalan, karena hal ini berpotensi membuat polyester lebih mudah rusak dan rapuh.

    Bisnis dengan Polyester

    Kalimat “you gotta have style” dari Diana Vreeland nampaknya mampu menggambarkan fleksibilitas dari polyester.

    Ada banyak bisnis yang bisa Anda lakukan dengan kain polyester. Misalnya, bisnis baju kasual, bisnis seragam reuni, bisnis goodybag, bisnis tas tote bag murah, atau bisnis kardigan.

    Polyester adalah bahan yang sangat mudah dijadikan apa saja. Lagipula, kain ini harganya murah. Jadi, Anda bisa mendapatkan keuntungan yang berlipat ganda saat berbisnis pakaian dan aksesori yang berbahan dasar polyester.

    Selain itu, amat mudah mencetak berbagai macam desain dan warna di atas baju dengan bahan dasar polyester.

    Dilihat dari segi ekonomi, polyester akan membawa keuntungan banyak. Pasalnya, bahan ini mudah diolah dan harganya pun amat terjangkau. Maklum, polyester memang bukan barang langka dan harganya tidak akan pernah naik secara drastis.

    Kini Anda sudah tahu kelebihan, kekurangan, dan serba-serbi lain terkait bahan polyester. Nah, bila tertarik, Anda bisa mencari bahan ini di toko kain terdekat.

  • Bahan Cordura: 6 Fakta Menarik Tentang Waterproof!

    Bahan Cordura: 6 Fakta Menarik Tentang Waterproof!

    Jika Anda adalah seorang awam di dunia bisnis kain dan busana, bahan cordura mungkin terdengar asing. Ya, bahan yang satu ini memang sering disebut, tetapi tak banyak yang benar-benar paham seperti apa dan bagaimana kegunaan bahan ini.

    Nah, apa yang dimaksud dengan kain cordura? Apakah bahan ini bermanfaat untuk Anda? Kenali serba-serbi bahan cordura waterproof di sini, mulai dari kelebihan, kekurangan, hingga untuk apa bahan ini biasa digunakan dalam keseharian.

    Pengertian

    Kain cordura awalnya diproduksi oleh perusahaan yang bernama E.I du Pont de Nemours and Company pada tahun 1929. Nah, dibuat dari apakah kain yang satu ini?

    Cordura dibuat dari campuran berbagai jenis bahan seperti nilon, kapas, serta bahan polyester. Melihat rumitnya proses pembuatan kain cordura, maka tak mengherankan apabila kain ini dianggap berkualitas dan juga merupakan kain yang kuat.

    Pemanfaatan

    Kain cordura bisa dimanfaatkan menjadi berbagai macam hal, seperti misalnya jaket, baju, dan tentu saja tas. Kain cordura memiliki serat-serat yang rapat dan juga mampu menahan beban berat.

    Tas yang terbuat dari kain cordura pun mampu menampung banyak barang di dalamnya, tetapi tetap ringan.

    Cordura memberikan kesan yang sporty dan juga modern. Tas berbahan cordura biasanya adalah tas untuk keperluan goodybag berkelas, tas olahraga, atau tas ransel sekolah.

    Sementara itu, baju yang terbuat dari bahan kain cordura biasanya merupakan jaket yang memang diperuntukkan di cuaca yang dingin, berbeda dengan bahan polycotton yang bisa dipakai di cuaca panas sekalipun.

    Kelebihan

    Kelebihan banyaknya produk yang menggunakan bahan dasar kain cordura menunjukkan betapa baik kualitas dari kain yang satu ini. Untuk lebih jelasnya, berikut beberapa kelebihan dari kain cordura yang sebaiknya Anda ketahui.

    Kuat

    Seperti yang sudah disebutkan sebelumnya, bahan cordura sangatlah kuat dan juga tidak mudah sobek. Kekuatan bahan ini berasal dari serat-serat rapat dan juga bahan nilon yang amat kuat dan berkualitas tinggi. Maka, tali pada tas outdoor juga dibuat dari cordura.

    Mampu menampilkan warna cerah

    Kain cordura mampu menampilkan warna dengan cerah, sehingga, barang-barang yang dibuat dari kain cordura terlihat mampu menarik perhatian banyak orang. Tidak mengherankan apabila tas sekolah dibuat dengan bahan ini.

    Ringan

    Meskipun mampu menampung banyak barang dan tidak mudah sobek, tetapi tas berbahan dasar cordura ini sangat ringan. Jadi, jika membawa tas cordura, Anda tidak akan merasa keberatan. Ini tentu berbeda dengan tas yang terbuat dari kulit.

    Antiair

    Mengapa ada banyak peralatan outdoor yang menggunakan cordura? Tentu saja ini karena sifat cordura yang antiair. Jadi, hujan ataupun hal lainnya tidak akan mudah menembus kain ini dan hal tersebut tentu sangat menguntungkan bagi petualang.

    Memang ada begitu banyak kelebihan yang bisa anda dapatkan dari cordura. Maka dari itu, tidak mengherankan apabila kain ini senantiasa laris manis dan diproduksi dalam jumlah banyak.

    Kekurangan

    Meskipun kain ini merupakan salah satu kain primadona, tetapi ada beberapa kekurangan dari kain ini yang sebaiknya Anda perhatikan. Nah, apa sajakah kekurangan dari kain berbahan dasar cordura?

    Yang pertama adalah penampilannya yang kurang mewah. Cordura tidak pernah memberikan kesan mewah, melainkan kesan sporty dan kasual.

    Maka dari itu, sulit menemukan tas mewah yang dibuat dari cordura. Kebanyakan tas mewah akan menggunakan kulit sebagai bahan dasarnya. Cordura sendiri biasanya dipakai untuk jaket sport, tas olahraga, serta tas-tas bernuansa kasual.

    Yang kedua, bahannya yang panas. Cordura tidak menyerap keringat dan tentu saja cukup pengap. Itulah alasan mengapa tidak ada banyak baju yang dibuat dari kain cordura, tidak seperti bahan lain, seperti bahan spandek, misalnya.

    Cordura biasanya dipakai untuk membuat jaket atau membuat rompi yang bisa menahan angin khusus untuk para pengendara sepeda motor.

    Yang ketiga, permukaan kain cordura kasar. Hal ini membuat cordura tidak bisa sepenuhnya dijadikan bahan pembuat pakaian. Perlu tambahan furing yang halus supaya kain ini bisa dipakai.

    Pemanfaatan untuk Bisnis

    Bila Anda ingin bisnis tas yang laris manis, cordura bisa dijadikan bahan utama. Sifatnya yang kuat tidak akan mengecewakan pelanggan.

    Selain itu, desain dan warna yang tercetak di atas kain cordura akan menimbulkan kesan yang unik, sehingga membuat produk Anda terlihat menawan.

    Cordura bisa juga dimanfaatkan sebagai bahan dasar sabuk. Ini merupakan alternatif dari sabuk kulit yang memang terkenal mahal. Sabuk cordura cocok dikenakan oleh anak muda dan juga cukup kuat.

    Anda juga bisa berbisnis peralatan outdoor, seperti tali untuk naik gunung, tali rompi, dan sebagainya. Sungguh luas peluang bisnis dari kain cordura ini, bukan?

    Perawatan

    Kain cordura memang tidak mudah kusut dan tidak perlu disetrika. Meski begitu, harus diakui bahwa kain cordura sulit untuk dibersihkan.

    Bila ada noda yang menempel, maka segera bersihkan cordura. Bila Anda menunda hal tersebut, kotoran akan meresap dan semakin sulit dihilangkan. Ini tentu membuat aksesori cordura Anda menjadi tidak enak dilihat.

    Gunakan detergen yang keras untuk menghilangkan noda membandel pada kain cordura. Bila perlu, gosok kotoran dengan menggunakan sikat gigi.

    Selain itu, menjemur kain cordura memang membutuhkan waktu yang lebih lama. Kain cordura cenderung menahan air di sela-sela seratnya.

    Bagaimana? Menarik bukan kain yang satu ini? Bahan cordura memang bukan bahan yang mudah dicari di mana-mana. Hanya toko kain tertentu yang menjualnya. Meski begitu, kain ini cukup unik dan tentu punya manfaat spesifik yang bisa dijadikan peluang bisnis.

  • zsh: illegal hardware instruction

    For people running Homebrew (brew), and getting ‘Illegal Instruction: 4’ with certain software, but specifically wget. They recently switched brew to compile with ‘Nehalem’ instructions. The oldest architecture still officially supported by Mojave.

    You can switch back to ‘core2’ instructions by editing /usr/local/Homebrew/Library/Homebrew/extend/os/mac/hardware.rb. Replace the elsif version and else branch result with “:core2” like this:
    Code:

    # frozen_string_literal: true
    
    module Hardware
      def self.oldest_cpu(version = MacOS.version)
        if CPU.arch == :arm64
          :arm_vortex_tempest
        elsif version >= :mojave
          :core2
        else
          :core2
        end
      end
    end

    Add this to /etc/hosts to break access to the pre-built packages:
    Code:

    0.0.0.0 homebrew.bintray.com
    

    You can then reinstall wget from source:
    Code:

    brew reinstall openssl wget --build-from-source
    

    A “roll your own brew upgrade”; This oneliner will stuff all the upgradable packages on a single brew reinstall line. Maybe that will work but it may fail with some bash error like a ‘commandline too long’. I had a pretty long list so you’ll probably be fine.
    Code:

    nice -n20 brew reinstall $(brew upgrade --dry-run | grep -v 'Updating Homebrew...' | grep -v '==> Would upgrade .* outdated packages:' | sed 's/\(.*\) .* .* .*$/\1/g') --build-from-source
    

    To check if you have any other pre-built packages installed, list all ‘internet bottles’ (needs jq):
    Code:

    brew install jq --build-from-source
    brew info --json=v1 --installed | jq -r "map(select(.installed[].poured_from_bottle) | .name) | unique | .[]"
    

    Reinstall all bottles that were not built yourself, but poored from an internet source (needs jq):
    Code:

    brew install jq --build-from-source
    for p in $(brew info --json=v1 --installed | jq -r "map(select(.installed[].poured_from_bottle) | .name) | unique | .[]"); do
      nice -n20 brew reinstall $p --build-from-source
    done
    

    Oneliner version:
    Code:

    nice -n20 brew reinstall $(brew info --json=v1 --installed | jq -r "map(select(.installed[].poured_from_bottle) | .name) | unique | .[]") --build-from-source
    

    Adapted from: https://stackoverflow.com/a/55038073/273668

    You’ll probably need to run that a couple of times, since dependencies may be poured from an internet bottle.

    https://forums.macrumors.com/threads/macos-10-14-mojave-on-unsupported-macs-thread.2121473/post-27026470

  • 6 Crazy Front-End Portfolios You Should Check Out

    6 Crazy Front-End Portfolios You Should Check Out

    Image for post
    Photo by Matthieu Comoy on Unsplash

    One of the toughest websites a web developer can make is a portfolio site showcasing all of the projects, experience, and skills.

    Not that building a portfolio site is programmatically challenging but because it is a place that potential employers will use to evaluate your work.

    Questions like “What projects to show first?” and “Should I add a photo of myself?” are just some of the many questions that come to mind when building a personal portfolio.

    Most web developers have built projects that aren’t unique like movie ratings or a calculator app.

    Therefore, one of the most differentiating factors for you can be building a highly unique portfolio site to showcase all these projects as well as any other past work.

    However, if you are looking to create a new project just for your portfolio, you can check my recent article on some of the most unique APIs.7 Free APIs That Nobody Is Talking AboutCreate unique and interesting apps using these APIsmedium.com

    Below are 6 highly unique portfolio websites you should definitely check out:

    1. Bruno Simon

    Bruno Simon is a creative developer and his portfolio is not a typical website that you’d come to expect.

    This is by far the most unique and interactive portfolio on this list.

    Bruno has created a uniquely immersive site, in which you can navigate using a car.

    The site is incredibly detailed and objects are moveable as well.

    As he states, he has used Three.js for the WebGL rendering.

    In fact, Bruno is on Medium and you can check his descriptive blog on the portfolio site.

    2. Ilya Kulbachny

    Ilya Kulbachnny’s site is one of the cleanest yet unique websites.

    Even though he has primarily used a black and white color scheme, he has worked on making the text large while adding a smooth scroll animation.

    Moreover, you can see that at the top of the page, the text “creative director” is also animated and he has used a personal photo of his as a background.

    Using a personal picture of yourself is important if you want to connect with your audience or you are a freelancer.

    Nonetheless, adding a personal picture won’t hurt and Ilya’s site demonstrates how he has used his personal picture which also has animate on scroll property.

    3. Abhishek Jha

    Abhishek’s portfolio follows the same color palette as the one above but his use of text, as well as the same animation on a scroll, gives it a unique touch.

    Another immediate takeaway is that he has replaced the default scrollbar with his own and also the cursor icon changes when you scroll over images.

    By placing the same text with different styles below one another and making the image overlap these texts is an interesting approach that, when used correctly, can be used to lay emphasis on particular texts.

    Not many people know but you can actually customize the scrollbar directly from your CSS file.

    /* width */
    ::-webkit-scrollbar {
    width: 10px;
    }

    /* Track */
    ::-webkit-scrollbar-track {
    background: #f1f1f1;
    }

    /* Handle */
    ::-webkit-scrollbar-thumb {
    background: #000;
    }

    /* Handle on hover */
    ::-webkit-scrollbar-thumb:hover {
    background: #355;
    }

    You can find more on this here.

    4. Robby Leonardi

    Much like Bruno Simon’s portfolio, this is also an interactive game. However, Bruno’s site included 3D graphics and a car to navigate, while this is a 2D game.

    Robby’s portfolio reminded me of the beloved Mario game.

    Robby Leonardi also has a portfolio site for illustrations and the same graphic and theme have made their way to it as well.

    He has done an outstanding job in making these sites and it’s rather out-of-box thinking.

    The background of his illustration portfolio as well as all the images used blend in perfectly, as well as showcases his finest works at the same time.

    5. Jacek Jeznach

    Another outstanding portfolio you should check out is by Jacek Jeznach.

    By using a very TikTok-like color palette and simple animations, he put together an enthralling website.

    The theme even extends to the map on the contacts page.

    He has even added background sound that you can easily toggle on and off.

    If you look closely you can even see that key HTML tags are present at the start and end of the webpage which is a neat addition to this site.

    This website is a great example of combining vibrant colors with a dark background and how to bring about an aspect of uniformity.

    6. Damian Watracz

    Damian’s site is a great example that giving attention to detail can drastically transform the site.

    This website utilizes a simple black and white color palette primarily.

    By combining simple animations, custom loading circles as well as the apt personal photo, Damian has managed to put together a very polished and professional website.

    One of the things I really liked about his site is that when you hover over the items in the menu, the background changes to reflect the link address page which is a thoughtful addition.

    Moreover, the pagination on this page is not common and really blends with the website.

    Another useful takeaway from this site is that the small yet notable contact button on the bottom left side of the page. It is a helpful shortcut that does not get in the way.

    Final thoughts

    Building a personal portfolio can be quite challenging.

    The main reason I have put together this list is to show that each portfolio site is unique and great in its own manner.

    There is no definite way you can go about while building sites like these.

    The only thing to keep in mind is to give your best and add your own personal touch to the site.

    If you enjoyed or felt inspired after reading this article, do check out my article on design inspirations.

  • 8 VSCode Extensions Every Developer Must Have

    Vedant Bhushan7 days ago

    These are awesome extensions! Maybe you could add tabnine as well.

    2

    2 replies

    Reply

    Jacob Bankston

    Jacob Bankston3 days ago

    Definitely picked up Turbo Console Log, and had a few of the others already! Great list overall.I would recommend adding indent-rainbow, it colorizes the indentations of lines to make your code more readable.

    1

    1 reply

    Reply

    Sylvain Pont

    Sylvain Pont7 days ago (edited)

    TCL is Amazing, thank you for that.Some remarks:Project manager seems to be a LOT more used than Projects. Whould you explain why you chose the later?VSCode now ships with Sync Settings. I used to use Settings sync extension but the VSCode one is…...

    Read More1 reply

    5 min read

    VS Code is one of the most popular and widely used code editor. It comes packed with lots of features that are free in comparison to other editors. You can download extensions on VS code, which add another dimension of incredible features.

    I have listed some of my favorite VS code extensions, without which I cannot live.

    Please note that there is no ranking involved. Each extension is impressive in itself. The last one and the first are equal.

    I am sure you will leave with a new extension that will make your work easier.

    1. Turbo Console Log

    Turbo console log is a killer extension when coming to the debugging part. This extension makes debugging easier by automating the process of writing meaningful log messages.

    You insert meaningful log message automatically with two steps:

    • Selecting the variable which is the subject of the debugging
    • Pressing ctrl + alt + L

    2. Import cost

    Speed is essential for your website. If your page or app can’t load quickly, it is the same as no page.

    This extension displays your import’s size. This way, you get to know how much you will be downloading and figure out why your application is sluggish.

    With this extension, you can decide if you should write a function or import the whole bundle.

    3. Prettier

    This extension is for everyone, be it If you code in python, JavaScript, or any other language.

    It makes your code, as the name suggests, prettier.

    I am terrible at giving equal lines and spacing and tab. As a result, my code looks just like some noodle pasta.

    With prettier, as soon as you press command+S, you will experience the magic. All your code will get correctly and equally spaced, and proper line spaces. Your code will look beautiful.

    No-One will ever identify how messy you are 😐.

    4. Bracket pair colorizer

    How many times it happens that when editing JavaScript code, you have trouble finding the closing brackets. It is painful to use the finger to trace the opening and closing brackets. Stop wasting your time and use this extension.

    Your opening and closing brackets are colored the same; it is easier this way.

    This extension is a must-have for those who have spent time with python because python doesn’t require brackets; this will help the transition.

    Image for post

    5. Live share

    Live share is a fantastic extension. With it, I can code with my friends, colleagues.

    Whenever I am stuck with a problem, I can pull over my friend to help me.

    What this extension does is that it gives remote control of your VS code editor, the opened files. With that, another person can change my code and save it—no need to struggle over the phone anymore or wait to meet your friend to get help.

    One of the features you get with this is that — You get to code in real-time. You get to know who is typing and what it is that they are entering. It makes coding just like messaging, which we all love. Thanks to VS code and live share. Besides, it also gives access to localhost, your terminal.

    Live share is one of the best features of VS code, in my opinion, and the reason I recommend it to everyone. I haven’t seen anything as good as it and free to use. Mind-blowing!

    Bonus: You can download the live share audio extension, which adds audio calling capabilities to Live Share. I love this and especially in the pandemic when everything has gone remote.

    6. Projects

    If you are working on several projects at a time, then switching between folders is hard. You have to navigate to the required folder. And if you switch between quite often, then it is hell.

    One use I find with this extension is that it can work as your favorite tab. E.g. Someone may store custom CSS and bootstrap in a folder and use this extension to navigate in between quickly.

    Image for post

    7. Settings Sync

    As the name suggests, setting sync extension stores all your setting backup in GitHub. This way, you can have the same settings for your multiple devices or new devices. Any changes made can be seamlessly synchronized.

    It allows you to sync pretty much everything you customize on VS Code to Github, from settings to keyboard shortcuts to other VS Code extensions.

    8. JavaScript (ES6) Code Snippets

    VS Code comes with built-in JS IntelliSense, but JS Code Snippetsenhances that experience further by adding premade JavaScript snippets, which contain the most commonly used snippets. No more repeating of code endlessly.

    The extension supports JS, TypeScript, JS React, TS React, HTML, and Vue.

    Image for post

    I hope you enjoyed reading and I provided value to you. If you find extensions that I have missed and you find it amazing, mention it in response.

    Thank You 🙌

    Ali Haider

    Over 5 years of obsession with technology || Writer and developer. I love making new friends, why don’t we be friends?

  • Creating the Front End in Laravel using Jetstream, Livewire, Sanctum, and Tailwind

    This tutorial would be the last part of our laravel-news application. We have already completed the migrations and modelsrelationships among models, and creating and consuming RESTful API. To create the user interface for admin users I have planned to use JetstreamLivewireSanctum, and Tailwind.

    The admin dashboard needs to be secure. Laravel comes with Laravel Jetstream which provides login, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management. Jetstream is designed using Tailwind CSS and offers your choice of Livewire or Inertia scaffolding.

    We have already used Laravel Sanctum to secure RESTful API in the previous tutorial.

    If you like Vue.js as a templating language then choose the Inertia.js stack provided by Jetstream.

    I am sticking to Blade as the templating language so I will use Livewire provided by Jetstream.

    Laravel Livewire is a library that makes it simple to build modern, reactive, dynamic interfaces. When using Livewire, you may pick and choose which portions of your application will be a Livewire component, while the remainder of your application can be rendered as the traditional Blade templates you are used to.

    Now let’s dive into code. There is make:livewire command which creates two files, one in app\Http\Livewire directory and another in resources\views\livewire directory.

    Different versions of this command are as follows:

    php artisan make:livewire foo
    # Creates Foo.php & foo.blade.php

    php artisan make:livewire foo-bar
    # Creates FooBar.php & foo-bar.blade.php

    php artisan make:livewire Foo\\Bar

    php artisan make:livewire Foo/Bar

    php artisan make:livewire foo.bar
    # Creates Foo/Bar.php & foo/bar.blade.php

    php artisan make:livewire foo --inline
    # Creates only Foo.php

    Before we start with our planned application, let us make few required edits in registration and profile update files provided by Laravel as there are first_name and last_name in our users table instead of the default name.

    If you have not changed the default migration for users table then you may skip this step.

    Open resources\views\auth\register.blade.php

    <div>
    <x-jet-label for="name" value="{{ __('Name') }}" />
    <x-jet-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus autocomplete="name" />
    </div>

    and replace the above code with the following code

    <div>
    <x-jet-label for="first_name" value="{{ __('First Name') }}" />
    <x-jet-input id="first_name" class="block mt-1 w-full" type="text" name="first_name" :value="old('first_name')" required autofocus autocomplete="first_name" />
    </div><div>
    <x-jet-label for="last_name" value="{{ __('Last Name') }}" />
    <x-jet-input id="last_name" class="block mt-1 w-full" type="text" name="last_name" :value="old('last_name')" required autocomplete="last_name" />
    </div>

    Open resources\views\profile\update-profile-information-form.blade.php

    <!-- Name -->
    <div class="col-span-6 sm:col-span-4">
    <x-jet-label for="name" value="{{ __('Name') }}" />
    <x-jet-input id="name" type="text" class="mt-1 block w-full" wire:model.defer="state.name" autocomplete="name" />
    <x-jet-input-error for="name" class="mt-2" />
    </div>

    and replace the above code with the following code

    <!-- First Name -->
    <div class="col-span-6 sm:col-span-4">
    <x-jet-label for="first_name" value="{{ __('First Name') }}" />
    <x-jet-input id="first_name" type="text" class="mt-1 block w-full" wire:model.defer="state.first_name" autocomplete="first_name" />
    <x-jet-input-error for="first_name" class="mt-2" />
    </div><!-- Last Name -->
    <div class="col-span-6 sm:col-span-4">
    <x-jet-label for="last_name" value="{{ __('Last Name') }}" />
    <x-jet-input id="last_name" type="text" class="mt-1 block w-full" wire:model.defer="state.last_name" autocomplete="last_name" />
    <x-jet-input-error for="last_name" class="mt-2" />
    </div>

    Then open app\Actions\Fortify\CreateNewUser.php and replace the create() with the following code:

    public function create(array $input)
    {
    Validator::make($input, [
    'first_name' => ['required', 'string', 'max:255'],
    'last_name' => ['required', 'string', 'max:255'],
    'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
    'password' => $this->passwordRules(),
    ])->validate();return User::create([
    'first_name' => ['required', 'string', 'max:255'],
    'last_name' => ['required', 'string', 'max:255'],
    'email' => $input['email'],
    'password' => Hash::make($input['password']),
    ]);
    }

    After that open app\Actions\Fortify\UpdateUserProfileInformation.php and replace update() and updateVerifiedUser() functions with the following code:

    public function update($user, array $input)
    {
    Validator::make($input, [
    'first_name' => ['required', 'string', 'max:255'],
    'last_name' => ['required', 'string', 'max:255'],
    'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)],
    'photo' => ['nullable', 'image', 'max:1024'],
    ])->validateWithBag('updateProfileInformation');if (isset($input['photo'])) {
    $user->updateProfilePhoto($input['photo']);
    }if ($input['email'] !== $user->email && $user instanceof MustVerifyEmail) {
    $this->updateVerifiedUser($user, $input);
    } else {
    $user->forceFill([
    'first_name' => $input['first_name'],
    'last_name' => $input['last_name'],
    'email' => $input['email'],
    ])->save();
    }
    }protected function updateVerifiedUser($user, array $input)
    {
    $user->forceFill([
    'first_name' => $input['first_name'],
    'last_name' => $input['last_name'],
    'email' => $input['email'],
    'email_verified_at' => null,
    ])->save();
    $user->sendEmailVerificationNotification();
    }

    At this point, we are ready to go with Laravel’s default registration and profile update functionality.

    Now move on to create pages to manage CategoriesTags, and Posts of our News Application.

    Our Category page will look like the following and have the functionality to list all categories, edit a category, show all posts of a category, delete a category, and create a new category.

    To create this page follow the below-mentioned steps:

    php artisan make:livewire Categories\\categories

    It will create Component and View files as discussed before.

    Open app\Http\Livewire\Categories\Categories.php and write the following code

    <?php
    namespace App\Http\Livewire\Categories;use App\Models\Category;
    use Livewire\Component;class Categories extends Component
    {
    public $categories, $title, $color, $category_id;
    public $isOpen = 0;public function render()
    {
    $this->categories = Category::all();
    return view('livewire.categories.categories');
    }public function store()
    {
    $this->validate([
    'title' => 'required',
    'color' => 'required',
    ]);Category::updateOrCreate(['id' => $this->category_id], [
    'title' => $this->title,
    'color' => $this->color
    ]);session()->flash('message', $this->category_id ? 'Category Updated Successfully.' : 'Category Created Successfully.');$this->closeModal();$this->resetInputFields();
    }public function delete($id)
    {
    Category::find($id)->delete();
    session()->flash('message', 'Category Deleted Successfully.');
    }public function edit($id)
    {
    $category = Category::findOrFail($id);
    $this->category_id = $id;
    $this->title = $category->title;
    $this->color = $category->color;
    $this->openModal();
    }public function create()
    {
    $this->resetInputFields();
    $this->openModal();
    }public function openModal()
    {
    $this->isOpen = true;
    }public function closeModal()
    {
    $this->isOpen = false;
    }private function resetInputFields()
    {
    $this->title = '';
    $this->color = '';
    $this->category_id = '';
    }
    }

    In the above code all the public properties are available to the view returned by render() method. List of all categories are passed to categories view by $categories variable.

    To create or update a category the store() method is wired in the view. In this method after validation a category is added or updated in the database and accordingly message is flushed.

    To delete a category delete() method is wired to delete button of view. The id of category to be deleted is passed to delete method from view and the same is deleted and message is flushed.

    The edit() method is wired to edit button of the view. It passes id of the category. Then the category data is fetched by this id and all the public variables are populted with that data which will now be available to model form.

    Then open resources\views\livewire\categories\categories.blade.php and write the following code

    <x-slot name="header">
    <h2 class="font-semibold text-xl text-gray-800 leading-tight">
    Categories
    </h2>
    </x-slot><div class="py-12">
    <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
    <div class="bg-white overflow-hidden shadow-xl sm:rounded-lg px-4 py-4">
    @if (session()->has('message'))
    <div class="bg-teal-100 border-t-4 border-teal-500 rounded-b text-teal-900 px-4 py-3 shadow-md my-3" role="alert">
    <div class="flex">
    <div>
    <p class="text-sm">{{ session('message') }}</p>
    </div>
    </div>
    </div>
    @endif<button
    wire:click="create()"
    class="inline-flex items-center px-4 py-2 my-3 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray disabled:opacity-25 transition ease-in-out duration-150">
    Create New Category
    </button>@if($isOpen)
    @include('livewire.categories.create')
    @endif<table class="table-fixed w-full">
    <thead>
    <tr class="bg-gray-100">
    <th class="px-4 py-2 w-20">No.</th>
    <th class="px-4 py-2">Title</th>
    <th class="px-4 py-2">Color</th>
    <th class="px-4 py-2">Action</th>
    </tr>
    </thead>
    <tbody>
    <?php $count = 1; ?>
    @foreach($categories as $category)
    <tr>
    <td class="border px-4 py-2"><?php echo $count++; ?></td>
    <td class="border px-4 py-2">{{ $category->title }}</td>
    <td class="border px-4 py-2"><span style="background-color: {{ $category->color }};">&emsp;</span> {{ $category->color }}</td>
    <td class="border px-4 py-2">
    <button
    wire:click="edit({{ $category->id }})"
    class="inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray disabled:opacity-25 transition ease-in-out duration-150">
    Edit
    </button>
    <a href="{{ url('dashboard/categories/'. $category->id .'/posts') }}" class="inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray disabled:opacity-25 transition ease-in-out duration-150">
    Show All Posts
    </a>
    <button
    wire:click="delete({{ $category->id }})"
    class="inline-flex items-center justify-center px-4 py-2 bg-red-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-500 focus:outline-none focus:border-red-700 focus:shadow-outline-red active:bg-red-600 transition ease-in-out duration-150">
    Delete
    </button>
    </td>
    </tr>
    @endforeach
    </tbody>
    </table>
    </div>
    </div>
    </div>

    Create one more view resources\views\livewire\categories\create.blade.php which will act as model to create and edit the category

    <div class="fixed z-10 inset-0 overflow-y-auto ease-out duration-400">
    <div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
    <div class="fixed inset-0 transition-opacity">
    <div class="absolute inset-0 bg-gray-500 opacity-75"></div>
    </div><!-- This element is to trick the browser into centering the modal contents. --><span class="hidden sm:inline-block sm:align-middle sm:h-screen"></span>​<div
    class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"
    role="dialog" aria-modal="true" aria-labelledby="modal-headline"><form>
    <div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
    <div class="">
    <div class="mb-4">
    <label for="exampleFormControlInput1" class="block text-gray-700 text-sm font-bold mb-2">Title:</label>
    <input type="text" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="exampleFormControlInput1" placeholder="Enter Title" wire:model="title">
    @error('title') <span class="text-red-500">{{ $message }}</span>@enderror
    </div>
    <div class="mb-4">
    <label for="exampleFormControlInput2"
    class="block text-gray-700 text-sm font-bold mb-2">Color:</label><textarea
    class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="exampleFormControlInput2" wire:model="color" placeholder="Enter Color"></textarea>
    @error('color') <span class="text-red-500">{{ $message }}</span>@enderror
    </div>
    </div>
    </div>
    <div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
    <span class="flex w-full rounded-md shadow-sm sm:ml-3 sm:w-auto">
    button wire:click.prevent="store()" type="button" class="inline-flex items-center px-4 py-2 my-3 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray disabled:opacity-25 transition ease-in-out duration-150">
    Save
    </button>
    </span>
    <span class="mt-3 flex w-full rounded-md shadow-sm sm:mt-0 sm:w-auto">
    <button wire:click="closeModal()" type="button" class="inline-flex items-center px-4 py-2 my-3 bg-white border border-gray-300 rounded-md font-semibold text-xs text-gray-700 uppercase tracking-widest shadow-sm hover:text-gray-500 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:text-gray-800 active:bg-gray-50 transition ease-in-out duration-150">
    Cancel
    </button>
    </span>
    </form>
    </div>
    </div>
    </div>
    </div>

    To show all the posts belonging to a category create app\Http\Livewire\Categories\Categoryposts.php file and write the following code

    <?php
    namespace App\Http\Livewire\Categories;use App\Models\Category;
    use App\Models\Post;
    use App\Models\Tag;
    use Illuminate\Support\Facades\Auth;
    use Illuminate\Support\Facades\DB;
    use Livewire\Component;
    use Livewire\WithPagination;class Categoryposts extends Component
    {
    use WithPagination;
    public $title, $content, $category, $post_id;
    public $tagids = array();
    public $isOpen = 0;
    public $cid;public function mount($id)
    {
    $this->cid = $id;
    }public function render()
    {
    return view('livewire.posts.posts', [
    'posts' => Post::where('category_id', $this->cid)->orderBy('id', 'desc')->paginate(),
    'categories' => Category::all(),
    'tags' => Tag::all(),
    ]);
    }public function store()
    {
    $this->validate([
    'title' => 'required',
    'content' => 'required',
    'category' => 'required',
    ]);$post = Post::updateOrCreate(['id' => $this->post_id], [
    'title' => $this->title,
    'content' => $this->content,
    'category_id' => intVal($this->category),
    'author_id' => Auth::user()->id,
    ]);if (count($this->tagids) > 0) {
    DB::table('post_tag')->where('post_id', $post->id)->delete();
    foreach ($this->tagids as $tagid) {
    DB::table('post_tag')->insert([
    'post_id' => $post->id,
    'tag_id' => intVal($tagid),
    'created_at' => now(),
    'updated_at' => now(),
    ]);
    }
    }
    session()->flash('message', $this->post_id ? 'Post Updated Successfully.' : 'Post Created Successfully.');$this->closeModal();$this->resetInputFields();
    }public function delete($id)
    {
    Post::find($id)->delete();
    session()->flash('message', 'Post Deleted Successfully.');
    }public function edit($id)
    {
    $post = Post::with('tags')->findOrFail($id);
    $this->post_id = $id;
    $this->title = $post->title;
    $this->content = $post->content;
    $this->category = $post->category_id;
    $this->tagids = $post->tags->pluck('id');
    $this->openModal();
    }public function create()
    {
    $this->resetInputFields();
    $this->openModal();
    }public function openModal()
    {
    $this->isOpen = true;
    }public function closeModal()
    {
    $this->isOpen = false;
    }private function resetInputFields()
    {
    $this->title = '';
    $this->content = '';
    $this->category = null;
    $this->tagids = null;
    $this->post_id = '';
    }
    }

    In the above code we are doing pagination as there might be many posts belonging to a category. To do so use Livewire\WithPagination then use paginate() method to get paginated records.

    In the above code block we have used mount() method, we use mount() method to intercept parameters. To get the id of category from URL we will use this method.

    This time we are passing posts, categories, and tags to view so we will pass these as an array in the second parameter while returning view.

    Rest of the code is mostly repetative. So I am ignoring for now.

    Now lets work on Posts. Posts page will look like this:

    Once again run make:livewire as follows:

    php artisan make:livewire Posts\\posts

    Open app\Http\Livewire\Posts\Posts.php file and paste the following code:

    <?php
    namespace App\Http\Livewire\Posts;
    use App\Models\Category;
    use App\Models\Image;
    use App\Models\Post;
    use App\Models\Tag;
    use Illuminate\Support\Facades\Auth;
    use Illuminate\Support\Facades\DB;
    use Illuminate\Support\Str;
    use Livewire\Component;
    use Livewire\WithFileUploads;
    use Livewire\WithPagination;class Posts extends Component
    {
    use WithPagination;
    use WithFileUploads;
    public $title, $content, $category, $post_id;
    public $tagids = array();
    public $photos = [];
    public $isOpen = 0;public function render()
    {
    return view('livewire.posts.posts', [
    'posts' => Post::orderBy('id', 'desc')->paginate(),
    'categories' => Category::all(),
    'tags' => Tag::all(),
    ]);
    }public function store()
    {
    $this->validate([
    'title' => 'required',
    'content' => 'required',
    'category' => 'required',
    'photos.*' => 'image|max:1024',
    ]);// Update or Insert Post
    $post = Post::updateOrCreate(['id' => $this->post_id], [
    'title' => $this->title,
    'content' => $this->content,
    'category_id' => intVal($this->category),
    'author_id' => Auth::user()->id,
    ]);// Image upload and store name in db
    if (count($this->photos) > 0) {
    Image::where('post_id', $post->id)->delete();
    $counter = 0;
    foreach ($this->photos as $photo) {
    $storedImage = $photo->store('public/photos');
    $featured = false;
    if($counter == 0 ){
    $featured = true;
    }Image::create([
    'url' => url('storage'. Str::substr($storedImage, 6)),
    'title' => '-',
    'post_id' => $post->id,
    'featured' => $featured
    ]);
    $counter++;
    }
    }// Post Tag mapping
    if (count($this->tagids) > 0) {
    DB::table('post_tag')->where('post_id', $post->id)->delete();
    foreach ($this->tagids as $tagid) {
    DB::table('post_tag')->insert([
    'post_id' => $post->id,
    'tag_id' => intVal($tagid),
    'created_at' => now(),
    'updated_at' => now(),
    ]);
    }
    }session()->flash('message', $this->post_id ? 'Post Updated Successfully.' : 'Post Created Successfully.');$this->closeModal();$this->resetInputFields();
    }public function delete($id)
    {
    Post::find($id)->delete();
    DB::table('post_tag')->where('post_id', $id)->delete();session()->flash('message', 'Post Deleted Successfully.');
    }public function edit($id)
    {
    $post = Post::with('tags')->findOrFail($id);
    $this->post_id = $id;
    $this->title = $post->title;
    $this->content = $post->content;
    $this->category = $post->category_id;
    $this->tagids = $post->tags->pluck('id');
    $this->openModal();
    }public function create()
    {
    $this->resetInputFields();
    $this->openModal();
    }public function openModal()
    {
    $this->isOpen = true;
    }public function closeModal()
    {
    $this->isOpen = false;
    }private function resetInputFields()
    {
    $this->title = null;
    $this->content = null;
    $this->category = null;
    $this->tagids = null;
    $this->photos = null;
    $this->post_id = null;
    }
    }

    The above code follows the same pattern as previous codes. Here I am uploading multiple files. To upload file use Livewire\WithFileUploads. Read more here about Livewire file upload.

    Open resources\views\livewire\posts\posts.blade.php and paste the following code:

    <x-slot name="header">
    <h2 class="font-semibold text-xl text-gray-800 leading-tight">
    Posts
    </h2>
    </x-slot><div class="py-12">
    <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
    <div class="bg-white overflow-hidden shadow-xl sm:rounded-lg px-4 py-4">
    @if (session()->has('message'))
    <div class="bg-teal-100 border-t-4 border-teal-500 rounded-b text-teal-900 px-4 py-3 shadow-md my-3"
    role="alert">
    <div class="flex">
    <div>
    <p class="text-sm">{{ session('message') }}</p>
    </div>
    </div>
    </div>
    @endif
    @if (Request::getPathInfo() == '/dashboard/posts')
    <button wire:click="create()" class="inline-flex items-center px-4 py-2 my-3 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray disabled:opacity-25 transition ease-in-out duration-150">
    Create New Post
    </button>
    @endif@if ($isOpen)
    @include('livewire.posts.create')
    @endif<div class="grid grid-flow-row grid-cols-3 gap-4">
    @foreach ($posts as $post)
    <div class="max-w-sm rounded overflow-hidden shadow-lg">
    <div class="px-6 py-4">
    <div class="font-bold text-xl mb-2">{{ $post->title }}</div>
    <p class="text-gray-700 text-base">
    {{ Str::words($post->content, 20, '...') }}
    </p>
    </div>
    <div class="px-6 pt-4 pb-2">
    <a href="{{ url('dashboard/posts', $post->id) }}"
    class="inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray disabled:opacity-25 transition ease-in-out duration-150">
    Read post
    </a><button wire:click="edit({{ $post->id }})"
    class="inline-flex items-center px-4 py-2 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray disabled:opacity-25 transition ease-in-out duration-150">
    Edit
    </button><button wire:click="delete({{ $post->id }})"
    class="inline-flex items-center justify-center px-4 py-2 bg-red-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-red-500 focus:outline-none focus:border-red-700 focus:shadow-outline-red active:bg-red-600 transition ease-in-out duration-150">
    Delete
    </button>
    </div>
    </div>
    @endforeach
    </div>
    </div>
    <div class="py-4">
    {{ $posts->links() }}
    </div>
    </div>
    </div>

    Then create file resources\views\livewire\posts\create.blade.php to be used as model for post create and edit and paste the following code:

    <div class="fixed z-10 inset-0 overflow-y-auto ease-out duration-400">
    <div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
    <div class="fixed inset-0 transition-opacity">
    <div class="absolute inset-0 bg-gray-500 opacity-75"></div>
    </div><!-- This element is to trick the browser into centering the modal contents. -->
    <span class="hidden sm:inline-block sm:align-middle sm:h-screen"></span>​<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full" role="dialog" aria-modal="true" aria-labelledby="modal-headline">
    <form>
    <div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
    <div class="">
    <div class="mb-4">
    <label for="title" class="block text-gray-700 text-sm font-bold mb-2">Title:</label>
    <input type="text" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="title" placeholder="Enter Title" wire:model="title">
    @error('title') <span class="text-red-500">{{ $message }}</span>@enderror
    </div><div class="mb-4">
    <label for="content" class="block text-gray-700 text-sm font-bold mb-2">Content:</label>
    <textarea rows="10" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="content" wire:model="content" placeholder="Enter Content"></textarea>
    @error('content') <span class="text-red-500">{{ $message }}</span>@enderror
    </div><div class="mb-4">
    <label for="category" class="block text-gray-700 text-sm font-bold mb-2">Category:</label>
    <select name="category" id="category" wire:model="category" class="shadow appearance-none w-full border text-gray-700 py-3 px-4 pr-8 rounded leading-tight focus:outline-none focus:shadow-outline"><option value="" selected>Select Category</option>
    @foreach ($categories as $category)
    <option value="{{ $category->id }}">{{ $category->title }}</option>
    @endforeach
    </select>
    @error('category') <span class="text-red-500">{{ $message }}</span>@enderror
    </div><div class="mb-4">
    <div x-data="{ isUploading: false, progress: 0 }"
    x-on:livewire-upload-start="isUploading = true"
    x-on:livewire-upload-finish="isUploading = false"
    x-on:livewire-upload-error="isUploading = false"
    x-on:livewire-upload-progress="progress = $event.detail.progress"><div class="flex">
    <label for="photos" class="block text-gray-700 text-sm font-bold mb-2">Images:</label>
    {{-- <div class="px-2" wire:loading
    wire:target="photos">Uploading</div> --}}
    <div x-show="isUploading" class="px-2">
    <progress max="100" x-bind:value="progress"></progress>
    </div>
    </div>
    <input type="file" multiple name="photos" id="photos" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" wire:model="photos">
    @error('photos') <span class="text-red-500">{{ $message }}</span>@enderror
    </div>
    </div><div class="mb-4">
    <label for="tagids" class="block text-gray-700 text-sm font-bold mb-2">Tags:</label>
    <select multiple name="tagids[]" id="tagids[]" wire:model="tagids" class="shadow appearance-none w-full border text-gray-700 py-3 px-4 pr-8 rounded leading-tight focus:outline-none focus:shadow-outline">
    @foreach ($tags as $tag)
    <option value="{{ $tag->id }}">{{ $tag->title }}</option>
    @endforeach
    </select>
    </div>
    </div>
    </div><div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
    <span class="flex w-full rounded-md shadow-sm sm:ml-3 sm:w-auto"><button wire:click.prevent="store()" type="button" class="inline-flex items-center px-4 py-2 my-3 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 active:bg-gray-900 focus:outline-none focus:border-gray-900 focus:shadow-outline-gray disabled:opacity-25 transition ease-in-out duration-150">
    Save
    </button>
    </span>
    <span class="mt-3 flex w-full rounded-md shadow-sm sm:mt-0 sm:w-auto">
    <button wire:click="closeModal()" type="button" class="inline-flex items-center px-4 py-2 my-3 bg-white border border-gray-300 rounded-md font-semibold text-xs text-gray-700 uppercase tracking-widest shadow-sm hover:text-gray-500 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:text-gray-800 active:bg-gray-50 transition ease-in-out duration-150">
    Cancel
    </button>
    </span>
    </form>
    </div>
    </div>
    </div>
    </div>

    To show single post create file app\Http\Livewire\Posts\Post.php and paste the following code:

    <?php
    namespace App\Http\Livewire\Posts;
    use App\Models\Post as PostModel;
    use Livewire\Component;class Post extends Component
    {
    public $post;
    public function mount($id)
    {
    $this->post = PostModel::with(['author', 'comments', 'category', 'images', 'videos', 'tags'])->find($id);
    }public function render()
    {
    return view('livewire.posts.post');
    }
    }

    Now create view for the single post resources\views\livewire\posts\post.blade.php and paste the following code:

    <x-slot name="header">
    <h2 class="font-semibold text-xl text-gray-800 leading-tight">
    Post
    </h2>
    </x-slot><div class="py-12">
    <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
    <div class="bg-white overflow-hidden shadow-xl sm:rounded-lg px-4 py-4">
    <div class="grid gap-4">
    <div class="font-bold text-xl mb-2">{{ $post->title }}</div>
    <div class="flex">
    by&nbsp;<span class="italic">{{ $post->author->first_name . ' ' . $post->author->last_name }}</span>
    &nbsp;in&nbsp;<a href="{{ url('dashboard/category/' . $post->category->id . '/posts') }}" class="underline">{{ $post->category->title }}</a>&nbsp;on&nbsp;{{ $post->updated_at->format('F, d Y') }}</div><div class="grid grid-flow-col">
    @foreach ($post->images as $image)
    <div class="px-6 py-4">
    <img src="{{ $image->url }}" alt="{{ $image->description }}" width="300" height="200">
    </div>
    @endforeach
    </div><div class="grid grid-flow-col">
    @foreach ($post->videos as $video)
    <div class="px-6 py-4">
    <img src="{{ $video->url }}" alt="{{ $video->title }}" width="300" height="200">
    </div>
    @endforeach
    </div><div class="text-gray-700 text-base">
    {!! $post->content !!}
    </div><div class="flex">
    @php
    $tags=$post->tags->pluck('id', 'title');
    @endphp
    @if (count($tags) > 0)
    Tags:
    @foreach ($tags as $key => $tag)
    <a href="{{ url('dashboard/tags/' . $tag . '/posts') }}" class="underline px-1">{{ $key }}</a>
    @endforeach
    @endif
    </div>@if ($post->comments->count())
    <div class="text-base">
    <p class="text-gray-900 pt-2 pb-4">{{ $post->comments->count() }}
    @if ($post->comments->count() > 1) Responses @else Response
    @endif
    </p><div class="bg-gray-100 overflow-hidden shadow-xl px-6 pt-4">
    @foreach ($post->comments as $comment)
    <div>
    <p class="text-gray-500 font-bold">
    {{ $comment->author->first_name . ' ' . $comment->author->last_name }}</p>
    <p class="text-gray-400 text-xs">{{ $comment->created_at->format('F, d Y g:i a') }}
    </p>
    <p class="text-gray-500 pb-4">{{ $comment->content }}</p>
    </div>
    @endforeach
    </div>
    </div>
    @endif
    </div>
    </div>
    </div>
    </div>
    {{-- https://www.php.net/manual/en/datetime.format.php --}}

    This completes Categories and Posts. Now Tags and navigation menus are remaining. I will update that here very soon.

    The source code is available at Github for you to refer to.

    Read the previous part, Creating and consuming RESTful API in Laravel of this tutorial.

    Twitter: kotagin

    GitHub: mdutt247

    E-mail: m.dutt@mditech.net