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 osascript -l JavaScript | |
function run(argv) { | |
if(argv.length == 0) { | |
console.log('Usage: play [ track ]'); | |
} else { | |
Application('iTunes').playlists[0].tracks.whose({ name: { _contains: argv.join(' ') } })[0].play(); | |
} | |
ObjC.import("stdlib") | |
$.exit(0) | |
} |
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
curl -v 'http://api.soundcloud.com/resolve.json?url=http://soundcloud.com/thewanshow/&client_id=[CLIENT_ID]' | |
http://feeds.soundcloud.com/users/soundcloud:users:[USER_ID]/sounds.rss |
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
var printAllNumbers = function() { | |
for(var i=0; i<Math.pow(36, 6); i++) { | |
var str = ""; | |
for(var j=0; j<7; j++) { | |
var char = Math.floor(i / Math.pow(10, j)) % 36; | |
if(char >= 26) | |
char += 22; | |
else | |
char += 97; | |
str += String.fromCharCode(char); |
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 notify(message, iconUrl, onclick) { | |
if (!Notification) { | |
alert(message); | |
return; | |
} | |
if (Notification.permission !== "granted") | |
Notification.requestPermission(); | |
var notification = new Notification('', { |
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 copytext(text) { | |
var textField = document.createElement('textarea'); | |
textField.innerText = text; | |
document.body.appendChild(textField); | |
textField.select(); | |
document.execCommand('copy'); | |
textField.remove(); | |
} | |
// credit to reddit.com/u/liamht |
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
var mineflayer = require('mineflayer'); | |
var navigatePlugin = require('mineflayer-navigate')(mineflayer); | |
var blockfinderPlugin = require('mineflayer-blockfinder')(mineflayer); | |
var scaffoldPlugin = require('mineflayer-scaffold')(mineflayer); | |
var Duties = require('duties'); | |
var BaseTask = function* BaseTask($) { | |
while(true) { | |
setTimeout($.resume, 500); |
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
var Duties = require('./index.js'); | |
var main = new Duties(); | |
var bot = new Bot(); // stub for other bot related code | |
var MiningTask = function* MiningTask(d, config) { | |
while(true) { | |
var block = bot.findBlockToBreak(); | |
d.add(NavigateTask, block.location); | |
d.add(BreakBlockTask, block); |
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
var MiningTask = function* MiningTask() { | |
for(var i=0; i<5; i++) { | |
yield breakBlock(); | |
} | |
} | |
var tasks = []; | |
tasks.push(MiningTask()); |
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
/^(4s?|5(c|s)?|6\+?)$/i |
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
import java.awt.Image; | |
import java.io.File; | |
import java.io.IOException; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Method; | |
import java.util.HashMap; | |
import java.util.Map; | |
import javax.imageio.ImageIO; |