Skip to content

Instantly share code, notes, and snippets.

View zulhfreelancer's full-sized avatar

Zulhilmi Zainudin zulhfreelancer

View GitHub Profile
@zulhfreelancer
zulhfreelancer / Readme.md
Created April 2, 2018 09:43 — forked from mxstbr/Readme.md
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
@zulhfreelancer
zulhfreelancer / push_more.rb
Created April 14, 2018 11:37 — forked from marckohlbrugge/push_more.rb
Example code for sending notification with Telegram's @PushMoreBot
require "net/https"
class PushMore
WEBHOOK_URL = "https://pushmore.io/webhook/REPLACE_WITH_YOUR_TOKEN"
def initialize(body)
@body = body
end
def deliver
@zulhfreelancer
zulhfreelancer / .change-tab-color-pwd
Created October 30, 2018 17:03 — forked from jakeonrails/.change-tab-color-pwd
How to have change the tab color in iTerm2 based on what folder or directory you are in
#!/usr/bin/env python
"""
Set terminal tab / decoration color by the server name.
Get a random colour which matches the server name and use it for the tab colour:
the benefit is that each server gets a distinct color which you do not need
to configure beforehand.
"""
@zulhfreelancer
zulhfreelancer / zsh.md
Last active March 21, 2020 05:28 — forked from tsabat/zsh.md
How to install zsh in Ubuntu 16 on EC2

Prereq:

If you want to change the hostname, follow this guide.

sudo apt update -y && sudo apt install -y zsh git-core

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

@zulhfreelancer
zulhfreelancer / cross-compile-go.bash
Created December 24, 2018 16:41 — forked from dlsniper/cross-compile-go.bash
Cross compile Go for Raspberry Pi 3
cd ~
git clone git@github.com:golang/go.git gotip
cd gotip/src
export GOROOT_BOOTSTRAP=/usr/local/go
env GOOS=linux GOARCH=arm GOARM=7 ./make.bash
@zulhfreelancer
zulhfreelancer / 1_phantomErrors.js
Created October 21, 2019 15:41 — forked from artjomb/1_phantomErrors.js
Error event handlers for PhantomJS and CasperJS: PhantomJS and CasperJS don't show errors on the page by default. This can give clues as to what did go wrong.
var page = require('webpage').create(),
url = 'http://example.com/';
// Put the event handlers somewhere in the code before the action of
// interest (opening the page in question or clicking something)
// http://phantomjs.org/api/webpage/handler/on-console-message.html
page.onConsoleMessage = function(msg, lineNum, sourceId) {
console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")');
};