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
// Usage: node getStats.js yarnpkg/yarn '2016-10-11T14:50:00.000Z' username password | |
// Note: install `async` and `github` packages | |
var async = require('async') | |
, GitHubApi = require("github"); | |
var github = new GitHubApi({ | |
// required | |
version: "3.0.0", | |
protocol: "https", |
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
<?php | |
class Singleton | |
{ | |
/** | |
* @var Singleton The reference to *Singleton* instance of this class | |
*/ | |
private static $instance; | |
/** | |
* Returns the *Singleton* instance of this class. |
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
<?php | |
$players = ["X", "O"]; | |
$current_player_idx = getPlayerIdx(); | |
$player = $players[$current_player_idx]; | |
$next_player_idx = getNextPlayerIdx($current_player_idx); | |
$board = [ | |
[null, null, null], |
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
<?php | |
/** | |
* Created by PhpStorm. | |
* User: nw | |
* Date: 9/8/15 | |
* Time: 8:33 PM | |
*/ | |
function ATM($withdraw, $balance) | |
{ | |
$transaction_fee = 0.50; |
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
# example uses shared folder /media/sf_vm/www, change for your needs | |
sudo usermod -a -G vboxsf www-data | |
sudo usermod -a -G vboxsf <user name> | |
cd /etc/apache2/sites-available | |
sudo cp 000-default.conf weblab.conf | |
sudo nano weblab.conf | |
// Change DocumentRoot to point at your shared mount `www` directory /media/sf_vm/www | |
// cntrl-x then 'Y' to save changes |
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 games = [ | |
"4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....1.4......", | |
"52...6.........7.13...........4..8..6......5...........418.........3..2...87.....", | |
"6.....8.3.4.7.................5.4.7.3..2.....1.6.......2.....5.....8.6......1....", | |
"48.3............71.2.......7.5....6....2..8.............1.76...3.....4......5....", | |
"....14....3....2...7..........9...3.6.1.............8.2.....1.4....5.6.....7.8...", | |
"......52..8.4......3...9...5.1...6..2..7........3.....6...1..........7.4.......3.", | |
"6.2.5.........3.4..........43...8....1....2........7..5..27...........81...6.....", | |
".524.........7.1..............8.2...3.....6...9.5.....1.6.3...........897........", |
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(){ | |
var input = $('#guess') | |
, btn = $('#guess_btn') | |
, status = $('#guesses') | |
, reset = $('#reset'); | |
var guesses = 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
var tessel = require('tessel') | |
, fs = require('fs') | |
, ambient = require('ambient-attx4').use(tessel.port['A']) | |
, audio = require('audio-vs1053b').use(tessel.port['D']); | |
var audioFile = fs.readFileSync('sample.mp3') // load mp3 into memory (small 29kb - 2.5 secs) | |
, timeout = 1000 * 60 // how long to wait after trigger and actions have happened. | |
, threshold = .2 // ambient noise trigger | |
, queue = 2; // number of modules to wait for |
NewerOlder