Skip to content

Instantly share code, notes, and snippets.

@og24715
og24715 / httpProxyWithApiGateway.md
Last active January 10, 2020 00:07
Setting an HTTP Proxy on API Gateway by using Serverless framework.

HTTP オールスループロキシーを serverless で定義する

service: httpAllThroughProxy

provider:
  name: aws
  runtime: nodejs6.10

  stage: dev
@chrisui
chrisui / action.js
Created April 11, 2016 19:22
Thunk Middleware with Custom API Utils
// Now your action creators can pull utilities our of their thunk api!
export function fetchUser(id) {
return ({api, dispatch}) =>
api.fetch(`users/${id}`).then(resp =>
dispatch({action: FETCH_USER, user: resp.body.data}));
}
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active October 1, 2024 17:10
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@sebmarkbage
sebmarkbage / Enhance.js
Last active November 7, 2024 13:05
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@michaelkoper
michaelkoper / backbone_pushstate_router.js
Last active October 5, 2016 21:28 — forked from tbranyen/backbone_pushstate_router.js
hijack links for pushState in Backbone. With open in new tab functionality.
// Use absolute URLs to navigate to anything not in your Router.
var openLinkInTab = false;
// Only need this for pushState enabled browsers
if (Backbone.history && Backbone.history._hasPushState) {
$(document).keydown(function(event) {
if (event.ctrlKey || event.keyCode === 91) {
openLinkInTab = true;
@plentz
plentz / nginx.conf
Last active November 14, 2024 08:35
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ivarvong
ivarvong / gist:2893838
Created June 8, 2012 05:49
nginx config for pushState with Backbone.js
server {
listen 80;
server_name trials.dailyemerald.com;
access_log /srv/www/trials.dailyemerald.com/access.log;
gzip on;
location / {
root /srv/www/trials.dailyemerald.com/public_html;
try_files $uri /index.html;
}
@wearethefoos
wearethefoos / varnish3.rb
Created February 23, 2012 10:48 — forked from hmsk/varnish3.rb
Install Varnish-3.0.2 on OSX with homebrew
require 'formula'
class Varnish3 <Formula
url 'http://repo.varnish-cache.org/source/varnish-3.0.2.tar.gz'
homepage 'http://www.varnish-cache.org/'
md5 'c8eae0aabbe66b6daabdf3a1f58cd47a'
depends_on 'pkg-config' => :build
depends_on 'pcre' => :build
@ryandotsmith
ryandotsmith / a-backbone-js-demo-app-sinatra-backend.md
Created January 22, 2012 01:42
Backbone demo app with sinatra backend

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments

In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].

@jehiah
jehiah / git-branch-status
Last active March 21, 2024 12:39
show git ahead/behind info for branches
moved to github --> https://github.com/bill-auger/git-branch-status/