This userscript allows you to customize how the files downloaded from the
codeboxes over at the autohotkey forum are named. By default they will all be
named Untilted.ahk
There are currently two versions of the script:
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
#include "MicroBit.h" | |
#include <vector> | |
using namespace std; | |
#define MAX_X 5 | |
#define MAX_Y 2 | |
#define MAX_HEIGHT 3 | |
#define MAX_COUNT 5 |
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
#include "MicroBit.h" | |
MicroBit uBit; | |
bool started = false; | |
bool isSender = false; | |
int whatToSend = 0; | |
void onButtonA(MicroBitEvent event) { |
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
alias wanip='dig +short myip.opendns.com @resolver1.opendns.com' | |
alias lanip='_lanip | column -t' | |
function _lanip(){ | |
for dev in $(ls /sys/class/net); do | |
echo -n $dev " " | |
net=$(ip -f inet addr show $dev | grep --color=never -Po 'inet \K[\d.]+?\/\d+') | |
if [[ -n $net ]]; then | |
echo -n $net | |
else |
Modifying the Backbone.localStorage adapter to accomodate special characters(eg: commas) in it's keys
Backbone.localStorage is for the most part, working without any problems.
It allows the user to assign a name to the storage instance, stores the model ids in the localStorage as a comma seperated string with the name as the key.
If the models don't have any ids they're awarded one by the adapter itself. Such ids take the format of a GUID.
The problem arises when one of the model ids contain a comma.
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 zsh | |
# Download this script | |
# Save it somewhere. Make it an executable with | |
# $ chmod +x terminal.zsh | |
# Then add a systemwide shortcut for this script | |
# and you're done! | |
# Get the current window id | |
ACTIVE=$(xdotool getactivewindow) | |
# Find all the sublime text windows that are open. |
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
// Constants. | |
var s = 1000; | |
var m = s * 60; | |
var h = m * 60; | |
var d = h * 24; | |
var y = d * 365.25; | |
// Specify the minimum a unit can be before | |
// `ms()` adds it to the output. |
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
// Finding all the require calls in coffee-script file. | |
// This won't work if a minified version of coffeescript is loaded.(Like @ http://coffeescript.org) | |
// Note that if the argument to require should be a string. `module = 'fs'\nfs = require(module)` wont work. | |
var CoffeeScript = require('coffee-script'); | |
// There are two requires calls. | |
var code = 'fs = require \'fs\'\nEventEmitter = require(\'events\').EventEmitter'; | |
var program = CoffeeScript.nodes(code); |
NewerOlder