Skip to content

Instantly share code, notes, and snippets.

@jyek
jyek / Angular.md
Last active August 29, 2015 13:57

Angular Notes

DOM content ready -> Angular compile -> app.config -> app.run -> runtime digest

Use watches to communicate between directives.

Use services and events to communicate between controllers.

@jyek
jyek / gist:11102427
Last active July 7, 2016 19:26
HR10 and HR11 Blogs
<a href="http://www.agchou.com" target="_blank">Aaron Chou</a>
<a href="http://latifs.github.io" target="_blank">Abdelatif Sebbane</a>
<a href="http://ardeibert.com" target="_blank">Adam Deibert</a>
<a href="http://www.addisonlee.io/" target="_blank">Addison Lee</a>
<a href="http://about.me/adriankim/" target="_blank">Adrian Kim</a>
<a href="http://0ptima.com/" target="_blank">Alejandro Sanchez</a>
<a href="http://www.lexjacobs.com" target="_blank">Alex Jacobs</a>
<a href="http://athompson.io" target="_blank">Allegra Thompson</a>
<a href="http://ariabennett.meteor.com" target="_blank">Aria Bennett</a>
<a href="http://charlesthehuman.com" target="_blank">Charles Tai</a>
http://expressjs-book.com/forums/topic/express-js-sessions-a-detailed-tutorial/
@jyek
jyek / gist:f96a0ba44a70fcf69635
Created May 16, 2014 02:18
nginx.conf for proxy
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
anx
bitfinex

#Node.js https & Express (SSL) Server

A simple https server using node.js (v0.10.0):

var https = require("https");
var  fs = require("fs");
 
var options = {
  key: fs.readFileSync('privatekey.pem'),
# PATH
export PATH=$PATH:usr/local/mysql/bin
# export PATH=/Users/justinyek/.local/bin:$PATH
# RVM
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# Z
. /usr/bin/z.sh
@jyek
jyek / ghost-next-prev-post
Last active November 8, 2021 09:38
Ghost Blog - Next Prev Posts
/*
* Ghost Blog: Next & Previous Posts Workaround
*/
// Step 1: Insert at end of default.hbs. Requires jQuery.
$(function(){
var NextPrevLinksModule = function(){
var curr,
$prevLink,
$nextLink;
@jyek
jyek / gist:e04cf59e9dcf823806da
Last active August 29, 2015 14:05
CSS Tricks
// Center vertical
.center-vertical {
position: relative;
top: 50%;
transform: translateY(-50%);
}
// Center horizontal
.center-horizontal {
position: relative;
@jyek
jyek / backbone-react-es6.js
Created January 5, 2017 14:32
Backbone React ES6
'use strict'
var React = require('react');
/**
* Backbone React Component
*
* Override getBackboneState to tell the mixin
* HOW to transform Backbone props into JSON state
*