Skip to content

Instantly share code, notes, and snippets.

View kitsunde's full-sized avatar
💭
Poisoning pigeons in the park

Kit Sunde kitsunde

💭
Poisoning pigeons in the park
View GitHub Profile
parseInt('06'); // 6
parseInt('08'); // 0
//Begäran:
{
"type" : "reCaptcha",
"host" : "unicodesnowmanforyou.com",
"img" : "ABSDFgewGSHSPGFKSDLKFSD"
}
//Svar:
{
"solved" : "cheesecake",
"errors" : [ "Not enough unicorns", "Server is unicorning" ]
/*
Why aren't you just deleting all images before update????
*/
public function saveImages( $movieInfo ){
if( DONT_SAVE_IMAGES ) return;
// $imageIds = array();
if( property_exists( $movieInfo, "posters" ) ){
foreach( $movieInfo->posters as $image ){
// $imageIds[ count( $imageIds ) ] = $image->image->id;
$this->saveImage( $movieInfo->id, $image->image );
@kitsunde
kitsunde / pojo.js
Created November 23, 2010 22:42 — forked from bcoe/pojo.js
var Person = endtable.Object.extend(
{
sayName: function() {
sys.puts('Hello, my name is ' + this.name + '!');
}
},
{
engine: engine,
type: 'person'
}
var ben = new Person({
name: 'Benjamin Coe',
age: 27,
sex: 'male',
interests: ['climbing']
});
ben.interests.push('programming');
@kitsunde
kitsunde / engine.js
Created November 23, 2010 22:43 — forked from bcoe/engine.js
var endtable = require('endtable');
var engine = new endtable.Engine({
database: 'people_example',
username: 'xxxxxx',
password: 'xxxxxx',
host: 'xxxxxx.couchone.com'
});
@kitsunde
kitsunde / load.js
Created November 23, 2010 22:44 — forked from bcoe/load.js
new Person().load({
keys: 'age',
startkey: 28,
endkey: 50
}, function(error, people) {
for (var i = 0; i < people.length; i++) {
people[i].sayName();
}
})
@kitsunde
kitsunde / functions.php
Created November 24, 2010 15:28
efficient_wp_list_authors doesn't rape your server: http://core.trac.wordpress.org/ticket/5407
<?php
function efficient_wp_list_authors($args = '') {
global $wpdb;
$defaults = array(
'optioncount' => false, 'exclude_admin' => true,
'show_fullname' => false, 'hide_empty' => true,
'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true,
'style' => 'list', 'html' => true
);
<?php wp_list_authors('show_fullname=1&optioncount=0'); ?>
Parts
id name brand category
1 Monsterchair 5000 ACME wheelchair
2 green-wheel ACME wheel
3 blue-wheel ACME wheel
4 frame-woo 3000 ACME wheelchair-frame
Part-relationship
parent child
1 4