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
#include "linkedlist.h" | |
int_node linked_list(int data, int_node *link) | |
{ | |
int_node l = {data, link}; | |
return l; | |
} |
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> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> | |
<script src="http://documentcloud.github.io/underscore/underscore-min.js"></script> | |
<script src="http://documentcloud.github.io/backbone/backbone-min.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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
sub oneLineArray | |
{ | |
my $a = shift @_; | |
my @array = @$a; | |
print "("; | |
foreach(@array){ | |
print " " . $_; | |
if($_ ne $array[$#array]){ | |
print ","; | |
} |
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 | |
$a = array(1, 2, 3, 4, 5); | |
$f = function($a) { return (($a * 2));}; | |
$b = array_values(array_map($f, array_filter($a, function($a) {return ($a > 2);}))); | |
var_dump($b); |
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
%% -*- coding: utf-8 -*- | |
-module(useless). | |
-export([useless/0, return_a_number/0, do_the_things_you_do/0]). | |
useless() -> | |
"I'm useless!÷". | |
return_a_number() -> | |
X = 4 + 4, | |
Y = X + 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
#!/usr/bin/perl | |
use utf8; | |
use Encode; | |
binmode STDOUT, ":encoding(UTF-8)"; | |
$string = "カタカナ, 片仮名"; | |
print "Internal Format: " . $string . "\n"; | |
$octets = encode("utf8", $string); | |
print "Encoded as UTF-8: " . $octets . "\n"; | |
print "Encoded as UTF-8(Unpacked as Hex): " . unpack("H*",$octets) . "\n"; |
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 | |
function removeSingularKeys($array, $parent="") | |
{ | |
$result = array(); | |
$result = $array; | |
foreach($array as $key => $value){ | |
if(keyIsTheSingularFormOf($key, $parent)){ | |
return $value; | |
} | |
if(is_array($value)){ |
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
Header set Access-Control-Allow-Origin * | |
Header set Access-Control-Allow-Headers "X-Requested-With, Content-Type" | |
Header set Access-Control-Allow-Methods "PUT, POST, GET, OPTIONS, DELETE" |
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
cd /tmp/ | |
hg clone http://hg.rabbitmq.com/rabbitmq-c/ rabbitmq-c | |
cd rabbitmq-c | |
hg clone http://hg.rabbitmq.com/rabbitmq-codegen codegen | |
autoreconf -i && ./configure && make && sudo make install | |
cd /tmp/ | |
lynx http://pecl.php.net/package/amqp #Download latest | |
tar -xvf amqp-1.0.1.tgz | |
cd amqp-1.0.1 | |
phpize && ./configure --with-amqp && make && sudo make install |
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 | |
//much of this borrowed from the amazon documentation | |
//http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/LowLevelPHPTableOperationsExample.html | |
require_once('include.php'); | |
$response = $dynamoDB->query(array( | |
'TableName' => $properties["table"]["TableName"] | |
, 'HashKeyValue' => array( | |
$properties["table"]["KeySchema"]["HashKeyElement"]["AttributeType"] | |
=> $hashKey ) |