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 | |
# Calculates Beats per Minute and confidence. | |
# Trigger function on ctrl+c | |
trap ctrl_c_handler INT | |
function ctrl_c_handler() { | |
echo -e "\n -> $index beats in $(echo "scale=2; $delta_sum /1"| bc) seconds. " | |
exit 0 | |
} |
This file has been truncated, but you can view the full file.
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
// One-liner to auto-mosh on photomosh.com | |
// Save this as the 'url' in a new bookmark and get moshing! | |
javascript:(function(){if (window.location.host != 'photomosh.com') window.location = 'https://photomosh.com'; else if (window.mosh) { clearInterval(window.mosh); window.mosh = 0; } else { var m = function(){document.getElementById('btn-mosh').click()}; window.mosh = setInterval(m, 5000); m();}})() |
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
/* thann */ | |
.info-well { | |
background-color: #272727; | |
border-color: #555; | |
color: #777; | |
} | |
.well-segment { | |
border-bottom-color: #555 !important; | |
} | |
.count, |
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
#!/usr/bin/env bash | |
# Runs a command, then kills it after a specified amount of time. | |
# USAGE: run4 10m watch date | |
${@:2} & PIDD=$!; | |
sleep "$1"; | |
# echo "==== STOPPED ===="; | |
kill -INT $PIDD; |
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
# Note: use following to determine "ID_MODEL" and replace "Micromax_A74" with it | |
# udevadm monitor --environment --udev | |
cat << EOF | sudo tee /etc/udev/rules.d/busKill.rules | |
ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_MODEL}=="Micromax_A74", RUN+="DISPLAY=:0 xscreensaver-command -lock" | |
EOF | |
sudo udevadm control --reload |
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
#!/usr/bin/env node | |
// SouthPark random expisode generator | |
// Comment out seasons to exlude them =] | |
const num_episodes = Object.entries({ | |
1: 13, | |
2: 18, | |
3: 17, | |
4: 17, | |
5: 14, |
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
#!/usr/bin/env node | |
// Takes in html and returns a parsed object! | |
class HTMLParser { | |
constructor(html, initialValues, extras) { | |
// Stores values during parsing | |
const values = initialValues || {}; | |
// Memoize all functions | |
for (const prop of EveryPropIn( this )) { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import enchant | |
import itertools | |
sample = "atlas shrugged" | |
d = enchant.Dict("en_US") | |
for s in itertools.permutations(sample, len(sample)): | |
s = ''.join(s) | |
if all(d.check(p) for p in s.split(' ') if len(p)): | |
print('--->', s) |
NewerOlder