This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"net/http" | |
"sync" | |
"github.com/gorilla/websocket" | |
) |
This file contains hidden or 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
// Place your key bindings in this file to override the defaults | |
[ | |
{ | |
"key": "cmd+enter", | |
"command": "renameFile", | |
"when": "explorerViewletVisible && filesExplorerFocus" | |
}, | |
{ | |
"key": "enter", | |
"command": "-renameFile", |
This file contains hidden or 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
module TaggedLogger | |
extend ActiveSupport::Concern | |
def log(message, additional_tags = [], log_level = :info) | |
begin | |
caller_name = caller[0][/`.*'/][1..-2].to_s | |
rescue StandardError | |
caller_name = "error_getting_method_name" |
This file contains hidden or 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
# add to application_controller.rb | |
# from: http://stackoverflow.com/questions/15274038/how-to-trace-redirect-to-in-a-rails-app-while-hunting-bugs | |
def redirect_to(options = {}, response_status = {}) | |
::Rails.logger.error("Redirected by #{caller(1).first rescue "unknown"}") | |
super(options, response_status) | |
end |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
#!/usr/bin/env ruby | |
gem 'psych' | |
require 'psych' | |
branch = `git branch | grep '*' | cut -c 3-`.chomp | |
branch.gsub! '/', '_' | |
branch.gsub! '-', '_' | |
f = Psych.load_file("config/database.yml") |
This file contains hidden or 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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# So, first thing: normally I'd use (or even create) some kind of framework. If we were using | |
# Rails for example we'd have functions and libraries like ActiveRecord that would make this look | |
# like nothing at all. I know whoever is reading this knows that; but I thought I'd state it. | |
require 'csv' | |
# So this is going to be main class. | |
class GrantGainsCalculator |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'csv' | |
class GrantGainsCalculator | |
@employees | |
@market_price_date | |
@market_price |
This file contains hidden or 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
<?php if( have_rows('locations') ): ?> | |
<?php while ( have_rows('locations') ) : the_row(); ?> | |
<h3><?php the_sub_field('location_name'); ?></h3> | |
<?php endwhile; ?> | |
<?php endif; ?> |
NewerOlder