Skip to content

Instantly share code, notes, and snippets.

View wayanjimmy's full-sized avatar
🏠
Working from home

Wayan jimmy wayanjimmy

🏠
Working from home
View GitHub Profile
@wayanjimmy
wayanjimmy / soFetch.js
Created November 30, 2018 02:41
Reusable fetch function from wesbos
// https://twitter.com/wesbos/status/1063515277911052290/photo/1
async function soFetch(input, settings = {}) {
const response = await fetch(input, {
headers: {
Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json'
},
...settings
});
@wayanjimmy
wayanjimmy / Dockerfile
Created November 9, 2018 23:21
Rails 5.2.1 + Ruby 2.5.3
FROM ruby:2.5.3
# Make nodejs and yarn as dependencies
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
# Install dependencies and perform clean-up
RUN apt-get update -qq && apt-get install -y \
build-essential \
@wayanjimmy
wayanjimmy / products.json
Last active September 30, 2018 05:27
Product List
[{"id":1,"name":"Sepatu Converse","price":3050,"desc":"aman","imageSrc":"https://images.nike.com/is/image/DotCom/PDP_HERO/132170C_001_A_PREM/converse-chuck-taylor-all-star-leather-unisex-high-top-shoe.jpg"},{"id":2,"name":"Vans","price":2000,"desc":"aman","imageSrc":"https://media.journeys.com/images/products/1_259094_ZM.JPG"},{"id":3,"name":"New Balance","price":550,"desc":"aman","imageSrc":"https://media.endclothing.com/media/f_auto,q_auto,w_760,h_760/prodmedia/media/catalog/product/0/5/05-07-2017_newbalance_u520avintage_blue_u520ab_eh_1.jpg"}]
@wayanjimmy
wayanjimmy / logslaravel.sh
Last active September 18, 2018 02:36 — forked from jakebathman/logslaravel.sh
Tail Laravel logs and filter out the stack traces
tail -f -n 450 storage/logs/laravel*.log \
| grep -i -E -C 4 \
"^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \
--color
@wayanjimmy
wayanjimmy / Faskes BPJS.postman_collection.json
Created August 30, 2018 07:05
Faskes BPJS Postman Collection
{
"info": {
"_postman_id": "692adab9-f9a9-48e0-8452-08ba65e36958",
"name": "Faskes BPJS",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Provinces list",
"request": {
@wayanjimmy
wayanjimmy / workshop-devcbali-coding-fundamental-js.md
Last active July 28, 2018 00:20
Workshop Dev Circle Bali - Coding Fundamental with Javascript

Git

Git adalah salah satu VCS (Version Control System)

  • Mengatur versi source code
  • Menambahkan checkpoint
  • Git bekerja secara local

Instalasi

@wayanjimmy
wayanjimmy / Dockerfile
Created June 7, 2018 01:51
Laravel Docker php7.2, mail testing, adminer and s3 mock using minio
FROM php:7.2-fpm
RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libpq-dev git\
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mbstring pdo pdo_mysql pdo_pgsql zip
#Get Composer
RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
@wayanjimmy
wayanjimmy / react-compound-component.js
Created May 18, 2018 06:38
React compund component
render() {
const children = React.Children.map(this.props.children, (child, index) => {
if (child.type === Panels) {
return React.cloneElement(child, {
activeIndex: this.state.activeIndex
});
} else if (child.type === List) {
return React.cloneElement(child, {
activeIndex: this.state.activeIndex,
onActivateTab: activeIndex => {
@wayanjimmy
wayanjimmy / Dockerfile
Created April 18, 2018 00:58
Rails Docker
FROM ruby:2.5.1
ENV LANG C.UTF-8
RUN apt-get update -qq && apt-get install -y build-essential mysql-client
RUN mkdir /workspace
WORKDIR /workspace
ADD Gemfile /workspace/Gemfile
ADD Gemfile.lock /workspace/Gemfile.lock
RUN bundle install