Skip to content

Instantly share code, notes, and snippets.

View remoharsono's full-sized avatar

Remo Harsono remoharsono

View GitHub Profile
@remoharsono
remoharsono / backup_mysqldb.sh
Created April 12, 2020 12:36 — forked from skarllot/backup_mysqldb.sh
Bash script to backup all mysql databases thru mysqldump
#!/bin/bash
# Destiny folder where backups are stored
DEST=/tmp/bacula/server01
CURRDATE=$(date +"%F")
# Hostname where MySQL is running
HOSTNAME="srv-mysql"
# User name to make backup
USER="root"
@remoharsono
remoharsono / modern_js.md
Created March 26, 2020 00:04 — forked from gaearon/modern_js.md
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@remoharsono
remoharsono / curl.md
Created March 6, 2020 07:11 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@remoharsono
remoharsono / gist:ec3631383481920aa458762b7caba19c
Created August 13, 2019 04:14 — forked from niczak/gist:2003485
PHP/SOAP and Microsoft Exchange
<?php
/*
test.php
Proof of concept testing to see if we can get
PHP/SOAP talking to EWS. Thanks to Thomas Rabaix
for his documentation on NTLM auth in SOAP and to
Erik Cederstrand for his article on SOAP/Exchange.
@remoharsono
remoharsono / curl.md
Created July 17, 2019 03:38 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@remoharsono
remoharsono / instagram_mine.py
Created April 18, 2019 02:17 — forked from rubinovitz/instagram_mine.py
A python script for downloading all of the instagram photos of a certain hashtag I wrote for a friend in 20 minutes (forgive sloppiness). Warning: you're only allowed 30 API requests an hour. Requires your own access token set as environment variable "access_token".
from datetime import datetime
import urllib2
import urllib
import json
import os
def ajaxRequest(url=None):
"""
Makes an ajax get request.
url - endpoint(string)
@remoharsono
remoharsono / supervisord.conf
Created March 20, 2019 08:01 — forked from lenciel/supervisord.conf
supervisor configuration file for sentry
;Notes:
; - Shell expansion ("~" or "$HOME") is not supported. Environment
; variables can be expanded using this syntax: "%(ENV_HOME)s".
; - Comments must have a leading space: "a=b ;comment" not "a=b;comment".
;
; Put this file in /etc/supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
@remoharsono
remoharsono / example_image_utils.py
Created March 16, 2019 12:50 — forked from turicas/example_image_utils.py
Layer on top of Python Imaging Library (PIL) to write text in images easily
#!/usr/bin/env python
# coding: utf-8
# You need PIL <http://www.pythonware.com/products/pil/> to run this script
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use
# any TTF you have)
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <http://www.gnu.org/copyleft/gpl.html>
from image_utils import ImageText
@remoharsono
remoharsono / .md
Created March 3, 2019 05:31 — forked from blagoeres/.md
⭐ Frontend tooling & development environment for OS X

Setup your development environment for OS X

I bought new Macbook Pro 15 Retina. These are tools I like to install on macOS operating system.

Checklist

Prep OS X

  • Download and install latest version of Xcode from the Mac App Store.
  • Download and install Apple's Command Line Tools by issuing this command xcode-select --install
@remoharsono
remoharsono / Enable HTTP2 (h2) in NGINX.md
Created March 3, 2019 05:30 — forked from blagoeres/Enable HTTP2 (h2) in NGINX.md
🌟 Hypertext Transfer Protocol Version 2 (HTTP/2) in NGINX ⭐