Skip to content

Instantly share code, notes, and snippets.

View wzulfikar's full-sized avatar
💭
Set status

Wildan Zulfikar wzulfikar

💭
Set status
View GitHub Profile
@wzulfikar
wzulfikar / DashSnippets.txt
Created September 28, 2016 08:11
Snippet I use with Dash app (OSX)
// the format is
// //{description}
// {snippet}
// {sample output}
// display right arrow
>`
// display left arrow
@wzulfikar
wzulfikar / laravel-nginx.txt
Last active November 16, 2016 03:06
default laravel nginx
server {
listen 80;
server_name my.domain.com;
root /opt/production/my-web;
index index.php;
rewrite_log on;
#access_log /var/log/nginx/access.log;
#error_log /var/log/nginx/error.log;
@wzulfikar
wzulfikar / docker-ps-vertical
Last active March 14, 2024 13:36
vertical format for docker ps
export FORMAT="ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nPORTS\t{{.Ports}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.CreatedAt}}\nSTATUS\t{{.Status}}\n"
// usage:
docker ps --format="$FORMAT"
@wzulfikar
wzulfikar / dt_editor.sql
Last active November 19, 2016 18:02
MySQL dump for Datatables Editor examples (https://editor.datatables.net/examples/index). Example for other DB: https://editor.datatables.net/manual/php/installing
--
--
-- MySQL tables used to run the Editor examples.
--
-- For more information about how the client and server-sides interact, please
-- refer to the Editor documentation: http://editor.datatables.net/manual .
--
--
@wzulfikar
wzulfikar / indonesia.sql
Last active November 29, 2016 16:55
Indonesia: provinces, districts, regencies, villages. Forked from github.com/edwardsamuel/Wilayah-Administratif-Indonesia
This file has been truncated, but you can view the full file.
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
@wzulfikar
wzulfikar / Install composer on Amazon AMI running on EC2
Last active December 27, 2016 14:26 — forked from asugai/Install composer on Amazon AMI running on EC2
Install composer on Amazon AMI running on EC2
cd ~
sudo curl -sS https://getcomposer.org/installer | sudo php
sudo mv composer.phar /usr/local/bin/composer
sudo ln -s /usr/local/bin/composer /usr/bin/composer
composer --version
@wzulfikar
wzulfikar / nginx-vhost-traccar
Created December 28, 2016 20:51
traccar config for nginx: proxy set for web & websocket. tested with cloudflare (https set to flexible). original: https://www.traccar.org/forums/topic/nginx-alias-configuration/
server {
listen 443;
listen 80;
server_name tracking.domain.com;
add_header Strict-Transport-Security max-age=63072000;
#client_max_body_size 200M;
# Security features
if ($http_user_agent ~* LWP::Simple|BBBike|wget) {
@wzulfikar
wzulfikar / Default.handlebars
Last active October 20, 2022 07:41
MacDown template that support mermaid diagram (http://knsv.github.io/mermaid/index.html). Save this snippet as `Default.handlebars` in `/Applications/MacDown.app/Contents/Resources/Templates/`
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
{{{ titleTag }}}
{{#each styleTags }}
@wzulfikar
wzulfikar / GetFbProfile.php
Created February 19, 2017 12:18
Get FB User Profile
<?php
/**
* fetch profile of given fb's user id. fields are optional.
*/
function getFbProfile($userId, array $fields = [])
{
$ACCESSS_TOKEN = 'YOUR_TOKEN_HERE';
$BASE_URL = 'https://graph.facebook.com/v2.6';
// fetch default fields if no fields passed
@wzulfikar
wzulfikar / orderSummary.ts
Created November 14, 2017 18:08
Using TypeScript to create order summary.
/**
* Wed, 15 Nov 2017 at 0:56:13 MYT
* "Using TypeScript to create order summary."
*
* The purpose of this snippet is to demonstrate the
* use of TypeScript in our code.
* You can run this code online here:
* https://www.typescriptlang.org/play/
*
* PS: