Skip to content

Instantly share code, notes, and snippets.

View ryanmr's full-sized avatar

Ryan Rampersad ryanmr

View GitHub Profile
{
"id":739,
"name":"Bulk Week",
"number":149,
"description":"ewoweihfweih",
"state":"preview",
"hidden":0,
"nsfw":0,
"created_at":"2015-06-24 19:05:52",
"updated_at":"2015-06-26 01:19:19",
(function(){
/**
* Push the local data up to the server.
* @param {[type]} episode [description]
* @return {[type]} [description]
*/
function push(episode) {
console.log('push: episode %o', episode);
}
/**
*
* An unusual proposition here.
*
* Using node to make a tiny console utility
* to parse my content specifically.
*
* q: ~~~
* + correct ~~~
* - wrong ~~~
ssh_header() {
echo "| -------------------"
echo "| SSH "
echo "| -------------------"
}
sshr() {
ssh_header;
echo "| ssh for remote home server"
class Rational(n: Int, d:Int) {
require(d != 0)
private val g = gcd(n.abs, d.abs)
val numerator: Int = n/g
val denomerator: Int = d/g
def this(n: Int) = this(n, 1)
{
"name":"ryan",
"number":"293",
"series":"5",
"state":"",
"hidden":"true",
"nsfw":"false",
"created_at":"2015-06-01 02:00:03",
"updated_at":"2015-06-01 02:00:03",
"content":"ifhoiefnoiwefoiwef",

This is a test gist.

Header

@ryanmr
ryanmr / array.php
Last active September 3, 2015 23:09
<?php
$ids = [39, 13, 17, 24];
$data = [];
foreach ($ids as $key => $id) {
$data[$id] = ['role' => 'host'];
}
// expected: [39 => ['role' => 'host'], 13 => ['role' => 'host'], 17 => ['role' => 'host'], 24 => ['role' => 'host']]
<?php
$url = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20woeid%3D12781740&format=json&diagnostics=true&callback=";
// $url = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20text%3D%22Macalester%20-%20Groveland%2C%20MN%22&format=json&diagnostics=true&callback=";
// $url = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20woeid%3D29306623&format=json&diagnostics=true&callback=";
$text = file_get_contents($url);
$data = json_decode($text, true);
function get_location($data) {