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
/** | |
* Arduino Song Code Generator - by Justin O'Boyle | |
* https://github.com/justinoboyle | |
* justin@justinoboyle.com | |
* | |
* This Node.JS script takes an input file of piano notation (I used notation from pianoletternotes.blogspot.com) and converts it into valid C++ code. | |
* | |
* Usage: | |
* node arduino-script.js # Uses bars.txt as input | |
* |
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
{ | |
"10012": "SoHo, Mn", | |
"10013": "Greenwich Village, Mn", | |
"10014": "West Village, Mn", | |
"10004": "Bowling Green, Mn", | |
"10005": "Financial District, Mn", | |
"10006": "Battery Park City, Mn", | |
"10007": "City Hall, Mn", | |
"10038": "Battery Park City, Mn", | |
"10002": "Lower East Side, Mn", |
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
main() { | |
# Use colors, but only if connected to a terminal, and that terminal | |
# supports them. | |
if which tput >/dev/null 2>&1; then | |
ncolors=$(tput colors) | |
fi | |
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then | |
RED="$(tput setaf 1)" | |
GREEN="$(tput setaf 2)" | |
YELLOW="$(tput setaf 3)" |
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
# add to .*rc | |
eval $(node -e "eval(new Buffer('bGV0IHsgcmVhZGRpclN5bmMgfSA9IHJlcXVpcmUoJ2ZzJyksIHsgam9pbiB9ID0gcmVxdWlyZSgncGF0aCcpOyBkaXJlY3RvcmllcyA9IFsgJy9BcHBsaWNhdGlvbnMvJywgJy9BcHBsaWNhdGlvbnMvVXRpbGl0aWVzJyBdO2RpcmVjdG9yaWVzLmZvckVhY2goZGlyID0+IHJlYWRkaXJTeW5jKGRpcikuZmlsdGVyKGEgPT4gYS5lbmRzV2l0aCgnLmFwcCcpKS5mb3JFYWNoKGZpbGUgPT4gY29uc29sZS5sb2coYFBBVEg9JFBBVEg6JHtqb2luKGRpciwgZmlsZSwgJy4vQ29udGVudHMvTWFjT1MnKS5zcGxpdCgnICcpLmpvaW4oJ1wgJyl9YCkpKQ==', 'base64').toString('ascii'))") |
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
const table = $($('table.list')[0]) | |
const rows = $(table.children()[0]).children() | |
let countRow = 0 | |
let heading = [] | |
let grades = [] | |
for(let row of rows) { | |
let rowData = {} | |
let countCol = 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
topD=document.getElementsByClassName('navigation-widget-content')[0]; | |
l=allDescendants(topD, 0); | |
console.log(l); | |
copy(l); | |
console.log("copied to clipboard in markdown format :)"); | |
function allDescendants (node, levels) { | |
let arr=[]; | |
if(node.childNodes) | |
for (var i = 0; i < node.childNodes.length; i++) { |
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 python2 | |
# Finds strings in executables, useful for analyzing malware. | |
# Usage: cat <filename> | ./extract-strings | |
import sys | |
import re | |
chars = r"A-Za-z0-9/\-:.,_$%'()[\]<> " | |
shortest_run = 4 |
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
// Java has this already, don't bother :) | |
Array.prototype.peek = function() { | |
return this[this.length - 1]; | |
} | |
// Cool, right? | |
let toClose = o => o.charCodeAt(0) == 40 ? String.fromCharCode(41) : String.fromCharCode(o.charCodeAt(0) + 2); | |
let toOpen = o => o.charCodeAt(0) == 41 ? String.fromCharCode(40) : String.fromCharCode(o.charCodeAt(0) - 2); | |
let matches = ['(', '[', '{'], |
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
//META{"name":"StaffPortal"}*// | |
var StaffPortal = function () {}; | |
StaffPortal.prototype.getName = function() { | |
return "StaffPortal"; | |
}; | |
StaffPortal.prototype.getDescription = function() { | |
return "Easier StaffPortal integration!"; | |
}; |
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
Show hidden characters
{ | |
"presets": ["es2015", "stage-0"] | |
} |