Skip to content

Instantly share code, notes, and snippets.

View wyqydsyq's full-sized avatar
🌏
Breaking the Internet

wyqydsyq wyqydsyq

🌏
Breaking the Internet
  • Brisbane, Australia
View GitHub Profile
@jjhiew
jjhiew / default.nginx.conf
Last active November 4, 2020 22:18
Nginx configuration to setup SSL Termination and Reverse Proxy for Sendgrid Link Tracking
# Should go into `/etc/nginx/sites-available` as file named `default`
# Redirect HTTP to HTTPS
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443;
@wyqydsyq
wyqydsyq / .tmux.conf
Last active June 19, 2017 04:32
My Tmux Config
run-shell "powerline-daemon -q"
source "/usr/lib/python3.6/site-packages/powerline/bindings/tmux/powerline.conf"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set-option -g renumber-windows on
set-option -g history-limit 9001
set -g base-index 1
set -g mouse on
@plukevdh
plukevdh / objectDiff.js
Last active April 11, 2022 13:56
Ramda - Compact diff output for complex objects.
import R from 'ramda'
const isObject = R.compose(R.equals('Object'), R.type);
const allAreObjects = R.compose(R.all(isObject), R.values);
const hasLeft = R.has('left');
const hasRight = R.has('right');
const hasBoth = R.both(hasLeft, hasRight);
const isEqual = R.both(hasBoth, R.compose(R.apply(R.equals), R.values));
const markAdded = R.compose(R.append(undefined), R.values);
@jeffcogswell
jeffcogswell / q_example.js
Last active August 12, 2022 01:22
Here's another chaining example on using q.js. This doesn't have any error handling, as I just want to demonstrate the chaining concept. Please read the comments carefully, as I start out with a non-q example, to show the order of flow. Please post comments if there's anything that isn't clear and I'll try to revise it as needed.
// Q sample by Jeff Cogswell
/*===========
We want to call these three functions in sequence, one after the other:
First we want to call one, which initiates an ajax call. Once that
ajax call is complete, we want to call two. Once two's ajax call is
complete, we want to call three.
BUT, we don't want to just call our three functions in sequence, as this quick