Skip to content

Instantly share code, notes, and snippets.

View wahyudibo's full-sized avatar

Wahyudi Wibowo wahyudibo

  • Yogyakarta, Indonesia
View GitHub Profile
@wahyudibo
wahyudibo / backup.md
Created April 21, 2020 04:33
Things to backup when reinstalling Ubuntu OS

Make a two-column list of your major likes and dislikes

Likes :

  • I like to try / discover new things, especially if it's related to my hobbies or interest such as programming, computer / console games, astronomy
  • I like to listen to people's story, make them laugh, or teach people things that's new to them
  • I like to try to solve puzzles or riddles or some problems in programming. Even if i'm not good at Math and often guess wrong, i still amaze with the solutions.

Dislikes :

@wahyudibo
wahyudibo / Curl.php
Created October 21, 2017 10:04
Example of Curl and Multi Curl in PHP
<?php
namespace App\Library\Curl;
class Curl {
private static $cookies, $proxy, $verbose, $mobile;
public static function setCookie($cookie_name){
self::$cookies = (dirname(getcwd()) . '/storage/app/cookies/'. $cookie_name . '.txt');
@wahyudibo
wahyudibo / script.js
Last active November 19, 2018 23:18
How to handle Promise fail fast behavior. Credits goes to : https://nmaggioni.xyz/2016/10/13/Avoiding-Promise-all-fail-fast-behavior/
let p1 = new Promise((resolve, reject) => {
setTimeout(resolve, 1000, "Everything OK in Promise 1");
});
let p2 = new Promise((resolve, reject) => {
reject(new Error("Something went wrong in Promise 2!"));
});
let p3 = new Promise((resolve, reject) => {
setTimeout(resolve, 2000, "Everything OK in Promise 3");
});
@wahyudibo
wahyudibo / change server timezone.md
Created November 27, 2016 04:01
Change server timezone (Ubuntu)

dpkg-reconfigure tzdata

@wahyudibo
wahyudibo / memcached mac os.md
Last active March 9, 2020 17:27
Install memcached on Mac OS

lists all memcached related packages

brew search memcached

install memcached as well as memcached extension for PHP

brew install memcached brew install php70-memcached

start memcached daemon with 24MB on port 11211 (default)

memcached -d -m 24 -p 11211

@wahyudibo
wahyudibo / MySQL strict mode off.md
Last active February 11, 2019 15:40
Turn off mysql 5.7 strict mode

Turn off MySQL 5.7 Strict Mode Globally

  • Check mysql mode SELECT @@sql_mode;
  • Add this snippet to /etc/mysql/my.cnf or if you install mysql via homebrew (MAC OS), you need to copy my.cnf with cp $(brew --prefix mysql)/support-files/my-default.cnf /usr/local/etc/my.cnf
[mysqld]
# Default : STRICT_TRANS_TABLES,ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
sql_mode = ""
  • Restart mysql
@wahyudibo
wahyudibo / Elasticsearch dynamic scripting.md
Last active November 24, 2016 15:42
Elasticsearch config for enable dynamic scripting

add this to end of elasticsearch.yml

script.inline: on
script.indexed: on
@wahyudibo
wahyudibo / 0_reuse_code.js
Created November 14, 2016 06:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@wahyudibo
wahyudibo / default.conf
Last active April 25, 2020 23:13
Install nginx, php 70 (with fpm), and mysql in Mac OS X
server {
listen 80;
server_name localhost;
root /Users/wahyudibo/Projects/mylabs/php/nginx;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#