Skip to content

Instantly share code, notes, and snippets.

View kriswill's full-sized avatar

Kris Williams kriswill

View GitHub Profile
@gaearon
gaearon / index.js
Last active January 5, 2022 18:45
Breaking out of Redux paradigm to isolate apps
import React, { Component } from 'react'
import Subapp from './subapp/Root'
class BigApp extends Component {
render() {
return (
<div>
<Subapp />
<Subapp />
<Subapp />
@assertnotnull
assertnotnull / mysql.yaml
Created July 27, 2018 14:26
kubernetes mysql init loading sql on entrypoint
---
apiVersion: v1
kind: Service
metadata:
name: mysql
spec:
ports:
- port: 3306
nodePort: 30306
selector:
@shripadk
shripadk / gist:652819
Created October 29, 2010 03:10
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
import Foundation
public func getASTString() -> String {
// get the file path for the file "test.json" in the playground bundle
// let filePath = NSBundle.mainBundle().pathForResource("FirstTtest", ofType: "ast")
// get the contentData
let contentData = NSFileManager.defaultManager().contentsAtPath("a.txt")
@reu
reu / denodify.js
Last active July 11, 2017 09:41
Convert any NodeJS async function into a Promise
module.exports = function denodify(fn) {
return function() {
var self = this;
var args = Array.prototype.slice.call(arguments);
return new Promise(function(resolve, reject) {
args.push(function(error, result) {
error ? reject(error) : resolve(result);
});