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 retry(isDone, next) { | |
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false; | |
var id = window.setInterval( | |
function() { | |
if (isDone()) { | |
window.clearInterval(id); | |
next(is_timeout); | |
} | |
if (current_trial++ > max_retry) { | |
window.clearInterval(id); |
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 | |
// 1. The class name must match the filename (i.e., "foo.php" for JSON_API_Foo_Controller) | |
// 2. Save this in your themes folder | |
// 3. Activate your controller under Settings > JSON API | |
class JSON_API_Example_Controller { | |
public function get_posts_by_meta_query() { | |
global $json_api; |
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 graph(data, w, h, color) { | |
var canvas = document.createElement('canvas'); | |
var max = 0; | |
// normalize | |
var len = data.length, i; | |
for(i = 0; i < len; ++i) { | |
max = Math.max(data[i], max); | |
} | |
for(i = 0; i < len; ++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
# Custom Stopwatch Scope | |
## As Simple Stopwatch | |
* Show total session time and lap count | |
* Show current lap time | |
* Show last lap time and time diff with previous | |
* Show best lap, time diff between last and best lap, and average lap time | |
* Log every session related data locally | |
* Transmit every session related data to remote server [^2] | |
* Share live session web page on FB, Twitter [^2] |
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 format(ms) { | |
//console.log(t[5]) | |
var d = new Date(ms + t[5]).toString() | |
.replace(/.*([0-9][0-9]:[0-9][0-9]:[0-9][0-9]).*/, '$1'); | |
var x = ms % 1000; | |
d += '.' + addZeros(Math.round(x), 3); | |
return d; | |
} | |
function addZeros(number, digits, place) { |
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 bash | |
#clone the repo | |
git clone -q "${1}" "clones/${2}" | |
cd "clones/${2}" | |
#update the submodules (how do we handle errors here?) | |
git submodule --quiet update --init --recursive |
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 | |
# | |
# Script that checks GitHub's status API before continuing. If GitHub does not return "good" then | |
# you will be prompted whether you want to continue. | |
# | |
# Information messages are echoed to stderr so it is still possible to pipe the results of stdout to | |
# a file. | |
# | |
# Example Usage: | |
# $ if-github-up make clean |
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 | |
// Disclaimer: no está probado en las últimas versiones de WP, pero antes se hacía así. | |
// Para el registro del user volviendo desde Paypal. | |
require_once( ABSPATH . WPINC . '/registration.php' ); | |
$user_pass = wp_generate_password(); | |
$userdata = array( |
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
5 OVER 1 | |
10 REM Primero los POKEs, por lo que pudiera pasar | |
20 REM Vidas infinitas | |
30 POKE 50437,1 | |
40 REM Dinero infinito | |
50 POKE 51181,24 | |
60 REM No morir de hambre | |
70 POKE 60298,201 | |
80 REM Ahora, al tajo | |
90 LET VIDAS=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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<style type="text/css"> | |
<!-- | |
#argh { | |
margin:20px; | |
padding:20px; | |
-moz-border-radius: 10px; |
NewerOlder