Skip to content

Instantly share code, notes, and snippets.

@hanchang
hanchang / print-all-crontabs
Created August 24, 2011 04:49
Script to print out all crontabs on a machine. Must be run as root.
#!/bin/bash
# Courtesy of:
# http://stackoverflow.com/questions/134906/how-do-i-list-all-cron-jobs-for-all-users
# System-wide crontab file and cron job directory. Change these for your system.
CRONTAB='/etc/crontab'
CRONDIR='/etc/cron.d'
# Single tab character. Annoyingly necessary.
@hanchang
hanchang / gakwt.js
Last active June 27, 2016 06:07 — forked from c93614/gist:3848993
Google Adwords Keyword Tool Scraper via Casper.js
// requires
var utils = require('utils');
var casper = require('casper').create()
var casper = require('casper').create({
verbose: true,
logLevel: "debug"
});
// setup globals
var email = casper.cli.options['email'] || 'REPLACE THIS EMAIL';
def max_sum_of_interval(list)
current_total = 0
max_total = 0
list.each do |item, index|
if item + current_total >= 0
current_total += item
max_total = current_total if current_total > max_total
else
current_total = 0
@hanchang
hanchang / Gitignore
Created June 4, 2014 16:16
Global gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
<!-- Here is the css code you'll need to put in between the <head><head> html tags: -->
<!-- Style this nonsense - @MercenaryCarter -->
<style type="text/css">
body {
margin: 0px;
}
@import url("https://fonts.googleapis.com/css?family=Raleway");
.introduction {
font-family: 'Raleway';

Keybase proof

I hereby claim:

  • I am hanchang on github.
  • I am hanchang (https://keybase.io/hanchang) on keybase.
  • I have a public key ASB-7nshRJhAnOUDQq1bzMWHvTJVuhvZRy-Y7gTiz317RQo

To claim this, I am signing this object:

@hanchang
hanchang / Rinkeby.md
Created January 12, 2018 05:29 — forked from learner-long-life/Rinkeby.md
How to get on Rinkeby Testnet in less than 10 minutes

How to get on Rinkeby Testnet in less than 10 minutes

Following instructions from the excellent https://www.rinkeby.io/

Synchronizing a Full Node

A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,

@hanchang
hanchang / passwordless-ssh.md
Created June 14, 2018 02:47 — forked from willemo/passwordless-ssh.md
Passwordless SSH/SFTP access to a server

Passwordless SSH/SFTP for dummies

To get SSH or SFTP access to a server without using a password you need to have a SSH key pair for each computer you want to be able to access the server from. In this document I’ll describe the steps you need to take to generate a key pair if you don’t have one already. If you do, you can use your public key(s) to get access to the server.

I'll also explain how to connect to your server using Cyberduck. Click here to skip to that part.

Disclaimer and stuff

This guide is written with newbies in mind, so I'm very thorough in describing the steps that you must take. This guide will not cover setting up the server side of this system. It assumes that there's a server running with SSH enabled.

@hanchang
hanchang / .git-completion.bash
Created July 4, 2018 13:51
Bash script to load Git branch name in prompt
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@hanchang
hanchang / tutorial.md
Created July 18, 2018 15:30 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.