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
git ls-files | grep '\.swp$' | xargs git rm |
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
/** | |
* @param {NS} ns | |
*/ | |
export async function main(ns) { | |
ns.print("Running hacking script..."); | |
var target; securityTreshold; moneyTreshold | |
// Identify the server to attempt to hack | |
var target = ns.args[0]; |
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
# Related area of style guide: https://github.com/GetJobber/ruby-style-guide#hash-fetch-defaults | |
# Pros: Is succinct and intuitive | |
# Cons: Doesn't work for false values | |
def default_one(options) | |
options[:foo] ||= 'foo' | |
options[:bar] ||= 'bar' | |
end | |
# Pros: Handles false without issue, is succient |
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
function solvePuzzle (clues) { | |
// The hint says the value | |
// that must *at least* be in the adjacent cell. | |
// 1 -> 4 | |
// 2 -> 3, etc. | |
// Calculate the possible permutations for each score in advance | |
// Rotate around in the order of hints, check if there is only | |
// one permutation that matches the hint and populated values, if | |
// so then populate it. |
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 Player | |
DIRECTIONS = [:left, :forward, :right, :backward] | |
def play_turn(warrior) | |
@warrior = warrior | |
bind_enemies! || | |
attack_enemies! || | |
heal! || |
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
# This is the common irbrc file used by all rvm ruby installations. | |
# This file will be overriden every time you update rvm. | |
# Turn on completion. | |
begin | |
require "readline" | |
require "irb/completion" rescue nil | |
# Turn on history saving. |
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
# Usage: | |
# $bm = Benchmarking.new | |
# VisitGeneratorWorker.new.perform(work_order.id) | |
# $bm.finish | |
# $bm.results | |
# | |
# Inside what you're benchmarking: | |
# $bm.mark("This is a data point") | |
# |
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
foreach(debug_backtrace() as $trace) { | |
echo $trace['file'] . "::" . $trace['function'] . "::" . $trace['line'] . "\n"; | |
} |
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
curl https://api.mover.io/connectors/lOVdV48pmWA7GDmmjkth/collections/DKLsd898sdKj/items \ | |
-X POST \ | |
-H "Authorization: MoverAPI app_id=2tsc0f9n9l4v209oara0mb2j5ur9my8v app_secret=65oow347p1q7d0loj45oje2u3sol99xd" \ | |
-F item=@"my_pic.jpg" |
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
curl -L -v --data "username=<username>@shaw.ca&password=<password>&acpt=on&language=en" https://wifisignon.shaw.ca/api/login |
NewerOlder