This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default () => (next) => (action) => { | |
if (performance.mark === undefined) return next(action) | |
performance.mark(`${action.type}_start`) | |
const result = next(action) | |
performance.mark(`${action.type}_end`) | |
performance.measure( | |
`${action.type}`, | |
`${action.type}_start`, | |
`${action.type}_end` | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psql -U postgres | |
#> update pg_database set datallowconn = TRUE where datname = 'template0'; | |
#> \c template0 | |
#> update pg_database set datistemplate = FALSE where datname = 'template1'; | |
#> drop database template1; | |
#> create database template1 with template = template0 encoding = 'UTF8'; | |
#> update pg_database set datistemplate = TRUE where datname = 'template1'; | |
#> \c template1 | |
#> update pg_database set datallowconn = FALSE where datname = 'template0'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rec -t wav - | ssh user@remotehost play -t wav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'haml' | |
require 'sinatra' | |
require 'redis' | |
helpers do | |
def redis | |
@redis ||= Redis.connect | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sprites: sprite-map("sprites/*.png"); | |
$sprites-retina: sprite-map("sprites-retina/*.png"); | |
@mixin sprite-background($name) { | |
background-image: sprite-url($sprites); | |
background-position: sprite-position($sprites, $name); | |
background-repeat: no-repeat; | |
display: block; | |
height: image-height(sprite-file($sprites, $name)); | |
width: image-width(sprite-file($sprites, $name)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: binary | |
# IRC <-> Campfire bridge, set IRC password to SUBDOMAIN:TOKEN and connect to localhost:6667 | |
# Remove special chars/spaces from channel names (ie "Foo Bar" becomes #FooBar). Only tested with LimeChat. | |
# gem install excon && gem install yajl-ruby -v "< 2.0" | |
%w[socket thread uri excon yajl yajl/http_stream].each { |lib| require lib } | |
Thread.abort_on_exception = true | |
[:INT, :TERM].each { |sig| trap(sig) { exit } } | |
server = TCPServer.new('127.0.0.1', 6667) | |
loop do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |