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 / 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 / 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 / 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 / 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
Last active March 11, 2019 02:47
Laravel Docker Permission Error
FROM php:7.3-fpm
RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libpq-dev libzip-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 bcmath exif
#Get Composer
RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
@wayanjimmy
wayanjimmy / MediaUploader.js
Created February 21, 2019 03:42
Media Uploader component
// @flow
import React from 'react';
import DropzoneComponent from 'react-dropzone-component';
import type {DropzoneState, DropzoneMedia} from 'react-dropzone-component';
import 'react-dropzone-component/styles/filepicker.css';
//$FlowFixMe
import 'dropzone/dist/min/dropzone.min.css';
import type {Media} from '../types/media';
@wayanjimmy
wayanjimmy / HistoryPanel.js
Created February 21, 2019 04:01
HistoryPanel
import React, {Component} from "react"
const dateTimeFormat = "DD/MM/YYYY h:mm:ss a"
function HistoryRows({histories}) {
return histories.map((data, index) => (
<tr key={index}>
<td>{data.message}</td>
<td>{moment(data.createdAt).format(dateTimeFormat)}</td>
<td>{data.createdBy}</td>
@wayanjimmy
wayanjimmy / assignment01.ts
Created February 21, 2019 14:22
Assignment #1
import { args } from 'deno'
import { parse } from 'https://deno.land/x/flags/mod.ts'
import { serve } from 'https://deno.land/x/http/server.ts'
enum ErrorCode {
NotFound = 400
}
const { p: port = 8080 } = parse(args)
const address = `0.0.0.0:${port}`
@wayanjimmy
wayanjimmy / assignment01.js
Created February 21, 2019 14:25
Assignment #1 - Node Master Class
import http from 'http'
import url from 'url'
// config object
const config = {
httpPort: 8080
}
// retrieve the third argument if user use custom port
if (process.argv.length > 2) {
@wayanjimmy
wayanjimmy / cli-apps-dev.md
Last active February 4, 2024 11:23
I curate a list of interesting CLI tools, below are some command line tools that I personally love and use

I curate a list of interesting CLI tools, below are some command line tools that I personally love and use

  • tmux - Terminal multiplexer.
  • ripgrep - Search text for patterns fast.
  • fzf - Command-line fuzzy finder.
  • exa - Replacement for ls written in rust.
  • git - Version control.
  • create-react-app - Create React apps with no build configuration.
  • npx - Execute npm package binaries.
  • wifi-password - Get the password of the WiFi you're on.