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
class ExampleJob < Job | |
schedule every: 30.minutes, | |
wait_until: Time.now.tomorrow.midnight | |
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
# Simulation of the Monty Hall problem | |
# | |
# In a given game, there are three doors with a prize behind one. | |
# The player picks one of the doors. | |
# Monty removes one of the non-selected doors that isn't the prize door. | |
# There are now two doors left in play, and one contains a prize. | |
# Monty asks the player if they'd like to switch doors. | |
# | |
# What should the player do? What is the probability the player will win if | |
# they switch doors vs staying the same? |
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
# | |
# Response Handler DSL Demo | |
# | |
# The goal of this update is twofold: | |
# 1. Make the code read more clearly about what it's doing | |
# 2. Remove the need for the understands? method to be written | |
# | |
# | |
# More Readable Code | |
# |
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 bash | |
# This script uses HTTPie, but could easily be adapted to use cURL. | |
# Change the host to be the location of your uTorrent server. | |
# Start this script and you'll get a prompt to paste in magnet links or links to torrent files | |
host=http://192.168.0.111:8080 | |
rpc=$host/gui/ | |
token="" |
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 bash | |
log_ssh_connection() { | |
[ -z "$SSH_CONNECTION" ] && echo "It appears you're not connected via SSH" && exit 0; | |
# SSH_CONNECTION="45.77.136.12 44298 10.240.0.6 22" | |
store=/var/log/ssh-logins.log | |
[ ! -e $store ] && sudo touch $store && sudo chmod a+w $store | |
if ! which jq >/dev/null; then |
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
using System; | |
using System.Collections.Generic; | |
using ActionList = System.Collections.Generic.List<System.Action>; | |
using ActionDict = System.Collections.Generic | |
.Dictionary<string, System.Collections.Generic.List<System.Action>>; | |
// A list of callbacks to easily implement the observable pattern | |
// Attach to any class as a public static for an easy interface | |
// |
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 bash | |
# Requirements: | |
# scrot (for screenshots) | |
# byzanz-record (for gif recordings) | |
pic_format="/home/jacob/Pictures/screenshots/%Y-%m-%d--%H-%M-%S--\$wx\$h.png" | |
gif_duration=10 | |
gif_format=$(date +"/home/jacob/Pictures/screenshots/%Y-%m-%d--%H-%M-%S--${gif_duration}s.gif") | |
client_id=c9a6efb3d7932fd |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Reticle : MonoBehaviour { | |
public GameObject prefab; | |
GameObject sprite; | |
LineRenderer line; |
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
function cd | |
set paths $CDPATH ./ | |
for location in $paths | |
if test -d $location$argv | |
builtin cd $location$argv | |
return | |
end | |
end | |
builtin cd $argv | |
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
let del = () => { | |
let links = [].slice.apply(document.querySelectorAll('.js-actionDelete button')); | |
let link = links.filter((el) => { return el.offsetHeight > 0 })[0]; | |
console.log(link); | |
if (link) { link.click(); } | |
let el = document.querySelector('.delete-action'); | |
if (el.offsetHeight > 0) { el.click(); } | |
} | |
setInterval(del, 300); |