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
// My solution to this /r/dailyprogrammer challenge on reddit (http://redd.it/278ptv) | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
var width = 0; | |
var height = 0; | |
var maze = []; | |
function getStartPoint() { | |
for(var x = 0; x < maze.length; x++) { |
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
package xyz.will.karelplusplus; | |
import stanford.karel.SuperKarel; | |
public class KarelPlusPlus extends SuperKarel { | |
private static final long serialVersionUID = 1L; | |
// Turn Right | |
public void turnRight() { |
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
/* | |
* Meteor timeAgo helper | |
* by | |
* MIT License | |
*/ | |
UI.registerHelper('formatTimeAgo', function(timestamp, options) { | |
var minute = 60; | |
var hour = minute * 60; | |
var day = hour * 24; | |
var week = day * 7; |
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 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; |
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
/^(4s?|5(c|s)?|6\+?)$/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
var MiningTask = function* MiningTask() { | |
for(var i=0; i<5; i++) { | |
yield breakBlock(); | |
} | |
} | |
var tasks = []; | |
tasks.push(MiningTask()); |
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
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 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 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 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('', { |
OlderNewer