Skip to content

Instantly share code, notes, and snippets.

View rustamli's full-sized avatar
🐜
🐜 🐜 🐜 🐜 🐜

Turan Rustamli rustamli

🐜
🐜 🐜 🐜 🐜 🐜
View GitHub Profile
@rustamli
rustamli / fibo.go
Last active May 8, 2016 01:08
Fibo Closure Function in Go
package main
import "fmt"
func fibonacci() func() int {
beforeLast, last := 0, -1
return func () int {
if last < 1 {
@rustamli
rustamli / timestamp.js
Created May 8, 2015 03:41
Timestamp in JavaScript
(new Date()).getTime().toString(36).toUpperCase()
@rustamli
rustamli / freebase-location-nearby.json
Created May 19, 2014 13:28
Find nearby objects using Freebase
[{
"id": null,
"name": null,
"/location/location/geolocation": [{
"latitude>=": 55.95,
"latitude<=": 55.96,
"latitude": null,
"longitude>=": -3.16,
"longitude<=": -3.15,
"longitude": null
@rustamli
rustamli / command.js
Last active December 29, 2015 15:09
Add to delicious for backtick.io
(function(){function f(i){if(i.origin!==e+""+n&&i.origin!==t+""+n){return}if(i.data==="destroy_bookmarklet"){var s=document.getElementById(r);if(s){document.body.removeChild(s);s=null}}}var e="http://",t="https://",n="delicious.com",r="DELI_bookmarklet_iframe",i=document.getElementById(r);if(i){return}var s=e+""+n+"/save?",o=document.createElement("iframe");o.id=r;o.src=s+"url="+encodeURIComponent(window.location.href)+"&title="+encodeURIComponent(document.title)+"&note="+encodeURIComponent(""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text))+"&v=1.1";o.style.position="fixed";o.style.top="0";o.style.left="0";o.style.height="100%25";o.style.width="100%25";o.style.zIndex="16777270";o.style.border="none";o.style.visibility="hidden";o.onload=function(){this.style.visibility="visible"};document.body.appendChild(o);var u=window.addEventListener?"addEventListener":"attachEvent";var a=u=="attachEvent"?"onmessage":"message";window[u](a,f,fa