Skip to content

Instantly share code, notes, and snippets.

View patrickskim's full-sized avatar

Patrick Kim patrickskim

View GitHub Profile
@ryenski
ryenski / hello.vue
Last active April 7, 2025 21:28
Stimulus.js + Vue.js
<template>
<div id="app">
<p>{{ message }}</p>
</div>
</template>
<script>
export default {
data: function () {
return {
@Integralist
Integralist / Fastly VCL Boilerplate for handling mutliple subdomains.vcl
Last active May 22, 2020 06:19
[Fastly VCL Boilerplate for handling mutliple subdomains] #fastly #vcl #boilerplate
######################################################################################
#
# detailed blog post on fastly's implementation details:
# http://www.integralist.co.uk/posts/fastly-varnish/
#
# fastly custom vcl boilerplate:
# https://docs.fastly.com/vcl/custom-vcl/creating-custom-vcl/#fastlys-vcl-boilerplate
#
# vcl_recv
# vcl_error
@johan
johan / LICENSE
Created January 23, 2017 22:25
A small ES6 credit card number validation and formatting library based on https://github.com/omarshammas/jquery.formance/blob/master/src/zfields/credit_card_number.coffee
Copyright (c) 2013 Omar Shammas ([email protected])
and Stripe ([email protected])
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@carolineartz
carolineartz / documents.rb
Last active July 19, 2019 16:44 — forked from dhh/documents.rb
dhh Rails resource example
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@henrik
henrik / deploying_phoenix_on_dokku.md
Last active February 24, 2025 17:33
Deploying Elixir's Phoenix Framework on Dokku.

Deploying Phoenix on Dokku

Worked 2015-09-08 for Phoenix 1.0.1 on Dokku 0.3.25.

These instructions assume you've set up Dokku. If not, go find a tutorial for that part. My notes for setting it up on Digital Ocean.

On your local machine, in the app's repo

Create a Dokku app:

@nathggns
nathggns / curry.es6.js
Created June 7, 2015 02:46
Recursive curry functions in ES6
function curry(fn, ...args) {
if (args.length === fn.length) {
return fn(...args);
}
return curry.bind(this, fn, ...args);
}
function add(a, b) {
return a + b;
@rattrayalex
rattrayalex / app.coffee
Last active September 11, 2018 23:46
Demo
Bacon = require('baconjs')
Imm = require('immutable')
React = require('react')
window.Actions =
changeFirstName: new Bacon.Bus()
changeLastName: new Bacon.Bus()
changeCountry: new Bacon.Bus()
addCountryBird: new Bacon.Bus()
addFriend: new Bacon.Bus()
@amatiasq
amatiasq / curry.js
Last active January 7, 2025 08:27
Simple way to recursively curry javascript functions http://jsfiddle.net/amatiasq/osrsomq0/
/**
* @param {Function} fn Function to curry.
* @param {Number} lenght The arguments required to invoke the function. Optional. By default is fn.length
* @returns {Function} The currified function.
*/
function curry(fn, length) {
length = length || fn.length;
return function currified() {
var args = [].slice.call(arguments);
@pnommensen
pnommensen / gist:707b5519766ba45366dd
Last active September 14, 2024 01:23
Ghost CMS with NGINX for Maximum Performance

Full blog post can be found here: http://pnommensen.com/2014/09/07/high-performance-ghost-configuration-with-nginx/

Ghost is an open source platform for blogging founded by John O'Nolan and Hannah Wolfe. It's a node.js application and therefore works great in conjunction with nginx. This guide will will help you create a high performance nginx virtual host configuration for Ghost.

"Don't use #nodejs for static content" - @trevnorris. If #nginx isn't sitting in front of your node server, you're probably doing it wrong.

— Bryan Hughes (@nebrius) August 30, 2014
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

The node.js application runs on a port on your server