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 body = $(document.body); | |
var b = body.getElement("b"); | |
//Listener class executes a logging function each time a method is called. | |
var Listener = new Class({ | |
listenStack: {}, | |
addListener: function(mth, fn) { | |
this.listenStack[mth] = this[mth]; | |
this[mth] = function() { | |
var rtrn = this.listenStack[mth].attempt(arguments); |
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
/* begin clever */ | |
pixel get_pixel(int dim, int i, int j, pixel *src) { | |
return src[RIDX(i, j, dim)]; | |
} | |
void four_corners(int dim, pixel *src, pixel *dst) { | |
pixel top_left = src[RIDX(0, 0, dim)]; | |
pixel top_right = src[RIDX(0, dim, dim)]; |
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
void ABStar::Final() { | |
platform->enter_state(); | |
if ( platform->get_nextChar() == 'a' ) { | |
platform->set_outputBuffer("In Final, found A"); | |
platform->next_state(); | |
NeedB(); | |
} else if ( platform->get_nextChar() != '\0' ) { | |
platform->set_outputBuffer("In Final, found something other than B"); | |
platform->next_state(); |
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
<?php | |
// pre_get_posts is hooked to run `include_the_fringe` | |
public function include_the_fringe( $query ) { | |
if ( $query->is_feed() && $query->is_main_query() && isset($_GET['fringe']) ) { | |
$ids = $this->find_fringe_episodes($query); | |
// $ids = json_decode('["490","491","381","245","219","168","132","130","126","122"]'); |
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
public static function human_time_difference($from, $to = '') { | |
if ( empty($to) ) { | |
$to = time(); | |
} | |
$periods = array( | |
'minutes' => array('%s minute', '%s minutes'), | |
'hours' => array('%s hour', '%s hours'), | |
'days' => array('%s day', '%s days'), | |
'weeks' => array('%s week', '%s weeks'), |
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
/* | |
Use ifupdown.com/putnam/generator.html | |
to generate a matrix and global values. | |
Then paste that generated code here. | |
*/ | |
void loop() { |
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 com.ifupdown.odin.adapters; | |
import android.content.Context; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.Log; | |
import android.util.SparseBooleanArray; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.CheckBox; |
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
#!/bin/bash | |
# don't forget to include ADB in your path | |
# for example, in your ~/.bashrc, somewhere near the top | |
# export PATH=$PATH:/path/to/android-sdk/sdk/platform-tools | |
# check if there is a filename | |
if [ -z "$1" ]; then | |
echo usage: $0 filename | |
exit |
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
use std::io; | |
use std::rand; | |
struct Monte { | |
h: uint, | |
k: uint, | |
r: uint | |
} | |
fn main() { |
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
fn multi() { | |
let tasks:uint = 4; | |
let (tx, rx): (Sender<uint>, Receiver<uint>) = channel(); | |
let mut senders = Vec::<Sender<uint>>::new(); | |
let mut receivers = Vec::<Receiver<uint>>::new(); | |
for i in range(0, tasks) { |
OlderNewer