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
### Keybase proof | |
I hereby claim: | |
* I am piersadrian on github. | |
* I am piersadrian (https://keybase.io/piersadrian) on keybase. | |
* I have a public key ASCoeLCUgnYQJT_mGy0DwhKdgcKXx-CEMQNYBLgMtGdosQo | |
To claim this, I am signing this object: |
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
#!/bin/bash | |
# 1: create new Space in Mission Control for Desktop 2 | |
# 2: create application structure and remember to chmod +x this file | |
# 3: fully configure browser and webapp | |
# 4: set "Options -> Assign to Desktop on Display 2" | |
skel_dir="$HOME/.chrome-user-data-appear-in" | |
tmp_dir="/tmp" |
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
{ | |
"extends": [ | |
"plugin:lodash/recommended", | |
"plugin:react/recommended", | |
"react-app" | |
], | |
"plugins": [ | |
"import", | |
"flowtype", | |
"jsx-a11y", |
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
{Point} = require 'atom' | |
atom.commands.add 'atom-text-editor', 'custom:tabcomplete', (e) -> | |
editor = atom.workspace.getActiveTextEditor() | |
cursor = editor.getLastCursor() | |
{row, column} = cursor.getBufferPosition() | |
precedingCharacter = editor.getTextInBufferRange([[row, column - 1], [row, column]]) | |
if /\S/.test(precedingCharacter) |
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 GameOfLife | |
def initialize(size) | |
@size = size | |
@grid = make_grid(true) | |
@next_grid = make_grid(false) | |
@grid_hash = nil | |
# Create offset masks excluding [0, 0], which is the cell in question. The | |
# masks look like [-1, 0] or [1, 1] and represent the offset from the |
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 SeedData | |
class << self | |
FILE_EXT = "json".freeze | |
MODEL_DIR = "#{ Rails.root }/db/models".freeze | |
# Dumps the contents every model into pretty-formatted JSON in the given | |
# directory. This lets us just make quick changes to the JSON structure and | |
# reimport the data (using #load) directly into the database. | |
def dump!(output_dir = MODEL_DIR) |
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
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseID]; | |
if (! cell) { | |
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseID]; | |
cell = [self addLabelsToCell:cell]; | |
} | |
NSDictionary *client = [[clientTypes objectAtIndex:indexPath.section] objectAtIndex:indexPath.row]; |
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
Show hidden characters
{ | |
"auto_complete_commit_on_tab": true, | |
"auto_complete_delay": 50, | |
"bold_folder_labels": true, | |
"caret_style": "phase", | |
"color_scheme": "Packages/tomorrow-theme/textmate/Tomorrow-Night.tmTheme", | |
"create_window_at_startup": false, | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ |
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
# routes.rb | |
constraints format: "html" do | |
get "*path", to: "angular#index", as: "angular" | |
end | |
# angular_controller.rb | |
class AngularController < ActionController::Base | |
VALID_PATHS = %w(/community /store /challenges /admin/health /admin/activities /admin/challenges /admin/budget) | |
before_action :verify_path! | |
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
module SessionsHelper | |
... | |
def authenticate! | |
raise ActionController::RoutingError.new("Unauthorized") unless signed_in? | |
end | |
end | |
class SomeController |
NewerOlder