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
var injector = angular.element('[data-ng-app="myAppName"]').injector(); | |
var dependency = injector.get('myDependencyName'); | |
dependency.doSomething(); |
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
var hands = [ | |
'rock', | |
'paper', | |
'scissors', | |
'water', | |
'dynamite' | |
]; | |
var opponents = [] |
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
puts gets.to_i.to_s(2) | |
# | |
# Best solution found: | |
# | |
#puts"%b"%gets |
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
# Ember data does not dirty the parent model if any of it's children change so | |
# no rollback can occur for a child. This fixes this by resetting a child's | |
# data to the internal data tracked by the parent model. | |
DS.Model.reopen | |
rollbackBelongsTo: (relationshipName) -> | |
thisName = @constructor.typeKey | |
relationshipInstance = @get relationshipName | |
# Rollback any attributes that were changed in the relationship | |
relationshipInstance.rollback() |
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 'csv' | |
csv_contents = CSV.read('Data.csv') | |
# Shift 3 rows of headers to get to the data | |
csv_contents.shift | |
csv_contents.shift | |
csv_contents.shift | |
set1 = [] | |
set2 = [] |
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 'csv' | |
# Iterate through each CSV file in the current folder | |
Dir.glob('*.csv') do |csv_filename| | |
# Create and open a new file to store the modified rows | |
csv_output_file = CSV.open("modified-#{csv_filename}", 'wb') | |
# Open the current file by filename | |
CSV.open(csv_filename, 'r') do |csv_contents| | |
# Iterate through each row in the CSV file | |
csv_contents.each do |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
$tooltipProvider.setTriggers({ | |
// other trigger config | |
'customOpen':'customClose' | |
}); |
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
var args = Array.prototype.slice.apply(arguments); | |
args[2] = false; |
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/sh | |
# | |
# Run this script before installing twikifier/twsock and after installing node | |
# | |
npm config set registry http://registry.npmjs.org/ | |
# Omit this step if a proxy is not needed | |
npm config set proxy http://<host>:<port> |
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/sh | |
USAGE="Usage: `basename $0` <src_space_url> <src_space> <src_user> | |
<src_pwd> <dest_space_url> <dest_space> <dest_user> <dest_pwd> | |
Overwrite SRC_TS_CHALLENGER and/or DEST_TS_CHALLENGER | |
to use a custom authentication method. | |
The default is tiddlywebplugins.tiddlyspace.cookie_form | |
" |
OlderNewer