Skip to content

Instantly share code, notes, and snippets.

View freddiefujiwara's full-sized avatar

Fumikazu Fujiwara | Freddie freddiefujiwara

View GitHub Profile
let s:commands = system('ditz --commands')
function! s:DitzComplete(cur, all, pos)
let args = split(strpart(a:all, 0, a:pos), ' ', 1)
if len(args) <= 2
return s:commands
elseif index(split(s:commands), args[1]) != -1
return system('ditz '.args[1].' "<options>"')
else
var a = document.getElementsByTagName('a'),directs=[];
function ypipesCallBack(data){
var d=eval("("+data.value.items[0].description+")");
for(var i = 0 ; i < a.length; i++){
if(a[i].target="veoh" && a[i].href=="http://www.veoh.com/videos/"+d.videoId){
a[i].href="http://www.veoh.com/iphone/#_Browse/rel/srch/all/0/"+d.title;
break;
}
}
}
<?php
$url = "http://pipes.yahoo.com/pipes/pipe.run?_id=ff2c266883f54d12c567b7876fd4f33c&_render=php&category=celebrity%2Fmusician";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$result = unserialize(curl_exec($ch));
print_r($result);
curl_close($ch);
*** ime.js.org 2010-09-28 23:46:02.000000000 +0900
--- ime.js 2010-09-28 23:26:53.741986819 +0900
***************
*** 120,125 ****
--- 120,126 ----
//////////////////////////////////////////////////////////////////////////////////////////
var ImeCGI_ = "http://api.chasen.org/ajaxime/";
+ var GoogleImeCGI_ = "http://kindle-3.appspot.com/api/transliterate?";
var ImeBackGroundColor_ = '#c0c0d0';
#!/usr/bin/env perl
use strict;
use warnings;
my $flickrRss = $ARGV[0] or die $!;
my $photoNo = 1;
open(RSS,"curl '$flickrRss' | grep jpg | sed 's/.*http/http/g' | sed 's/jpg\".*\$/jpg/g' | grep -v m.jpg |") or die $!;
while(<RSS>){
chomp;
@freddiefujiwara
freddiefujiwara / get_barcode_from_image.js
Created August 28, 2011 07:33 — forked from tobitailor/get_barcode_from_image.js
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
@freddiefujiwara
freddiefujiwara / gist:1420760
Created December 1, 2011 23:47
Triangable max
var isTriangable = function(a,b,c){
var max = Math.max.apply(null,[a,b,c]);
var tmp = $([a,b,c]).filter(function(i,v){
return v != max;
});
if(2 != tmp.length){
return true;
}
return max < (tmp[0] + tmp[1]);
};
@freddiefujiwara
freddiefujiwara / gist:1449270
Created December 8, 2011 23:38
ant problem
var solve= function (L,ants){
var times = [];
var minTimes = []
for(var i = 0 ; i < ants.length ; i++){
times.push(ants[i]);
times.push(L-ants[i]);
minTimes.push(ants[i] > L-ants[i] ? L-ants[i] : ants[i]);
}
@freddiefujiwara
freddiefujiwara / gist:1449329
Created December 8, 2011 23:56
sum problem
var solve = function(k,arr){
var sums = {};
var sum = function(a){
var s = 0;
for(var j = 0 ; j < a.length ; j++){
s += a[j];
}
return s;
};
length = arr.length;