Skip to content

Instantly share code, notes, and snippets.

Joe Fiorini joefiorini

Block or report user

Report or block joefiorini

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@branneman
branneman / fp-lenses.js
Last active Jul 14, 2019
JavaScript: Lenses (Functional Programming)
View fp-lenses.js
// FP Lenses
const lens = get => set => ({ get, set });
const view = lens => obj => lens.get(obj);
const set = lens => val => obj => lens.set(val)(obj);
const over = lens => fn => obj => set(lens)(fn(view(lens)(obj)))(obj);
const lensProp = key => lens(prop(key))(assoc(key));
@maisano
maisano / RouteTransition.jsx
Last active Jan 21, 2019
Using react-motion with react-router
View RouteTransition.jsx
import React, { PropTypes } from 'react';
import { TransitionMotion, spring } from 'react-motion';
/**
* One example of using react-motion (0.3.0) within react-router (v1.0.0-rc3).
*
* Usage is simple, and really only requires two things–both of which are
* injected into your app via react-router–pathname and children:
*
* <RouteTransition pathname={this.props.pathname}>
@strobe
strobe / .emacs
Last active Aug 6, 2016
osx emacs config for scala
View .emacs
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; !! General Settings !!
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
@alanpeabody
alanpeabody / .projections.json
Last active Aug 29, 2015
Ember App Kit & vim-projectile
View .projections.json
{
"app/models/*.js": {
"command": "model",
"template": [ "export default DS.Model.extend({", "});" ]
},
"app/router.js": { "command": "router"},
"app/routes/*.js": {
"command": "route",
"template": [ "export default Ember.Route.extend({", "});" ],
"alternate": "app/controllers/%s.js"
View Gruntfile.js
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
aws: grunt.file.readJSON(process.env.HOME + '/grunt-aws.json'),
copy: loadConfig('copy'),
concat: loadConfig('concat'),
s3: loadConfig('s3'),
dockerfiles: {
options: {
packageInstall: 'pacman -S --noconfirm "<%= package.name %><%= package.version %>"',
// or function(name, version) { return "pacman -S --noconfirm " + name + version; }
@bigfive
bigfive / active_admin_helper.rb
Last active Nov 15, 2018
Active admin reskin
View active_admin_helper.rb
module ActiveAdminHelper
def admin_arbre_context
@admin_arbre_context ||= Arbre::Context.new(assigns, self)
end
def default_renderer
case controller.send(:resource_class).name
when "ActiveAdmin::Page"
"page"
@crosbymichael
crosbymichael / server.go
Created May 26, 2013
Quick and simple static file server in Go. No more python -m SimpleHttpServer
View server.go
package main
import (
"flag"
"fmt"
"log"
"net/http"
"os"
)
@theotherzach
theotherzach / 20130310141955_add_hstore_extension.rb
Last active May 24, 2016
Rails 4 and Postgres: Getting HStore and Array
View 20130310141955_add_hstore_extension.rb
class AddHstoreExtension < ActiveRecord::Migration
def up
execute 'CREATE EXTENSION hstore'
end
def down
execute 'DROP EXTENSION hstore'
end
end
@waylan
waylan / foo.sh
Created Nov 15, 2012
Simple bash subcommands. Each subcommand is implemented as a function. For example, `sub_funcname` is called for `funcname` subcommand.
View foo.sh
#!/bin/sh
ProgName=$(basename $0)
sub_help(){
echo "Usage: $ProgName <subcommand> [options]\n"
echo "Subcommands:"
echo " bar Do bar"
echo " baz Run baz"
echo ""
You can’t perform that action at this time.