Skip to content

Instantly share code, notes, and snippets.

View LispyAriaro's full-sized avatar

Efe Ariaroo LispyAriaro

  • London, United Kingdom
View GitHub Profile
(ns three.demo)
(def camera (THREE.Camera. 75 (/ window/innerWidth
window/innerHeight) 1 10000))
(set! (.z (.position camera)) 1000)
(def scene (THREE.Scene.))
(def geometry (THREE.CubeGeometry. 200 200 200))
(def obj (js/Object.))
(set! (.color obj) 0xff0000)
(set! (.wireframe obj) true)
(def material (THREE.MeshBasicMaterial. obj))
public void DisableAllButtons()
{
if (true)
{
int firstNum = 10;
}
int firstNum = 5;
//error message shown by visual studio
//A local variable named 'firstNum' cannot be declared
//in this scope because it would give a different meaning to 'firstNum'
@LispyAriaro
LispyAriaro / DD.jl
Last active August 29, 2015 14:20 — forked from kmsquire/DD.jl
module DD
import Base: similar, sizehint, empty!, setindex!, getindex, get,
pop!, delete!, start, next, done, isempty, length
export DefaultDict
type DefaultDict{K,V,F} <: Associative{K,V}
d::Dict{K,V}
@LispyAriaro
LispyAriaro / DD.jl
Last active August 29, 2015 14:20 — forked from kmsquire/DD.jl
module DD
import Base: similar, sizehint, empty!, setindex!, getindex, get,
pop!, delete!, start, next, done, isempty, length
export DefaultDict
type DefaultDict{K,V,F} <: Associative{K,V}
d::Dict{K,V}
efeariaroo@efeariaroo-HP-Compaq-6720s:~/Documents/PROJECTS/ERLANG/bson-erlang$ git branch
* master
efeariaroo@efeariaroo-HP-Compaq-6720s:~/Documents/PROJECTS/ERLANG/bson-erlang$ git checkout 6d92bf4bc16b6b2c1d3bd58be2745048b91bf0a6
Note: checking out '6d92bf4bc16b6b2c1d3bd58be2745048b91bf0a6'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
(defn get-largest-products
([input-nums]
(get-largest-products input-nums 0 []))
([input-nums curr-index so-far]
(if (== (count input-nums) (count so-far))
so-far
(let [multiply-val (input-nums curr-index)
multiples (for [i (range (count input-nums))
:when (not= i curr-index)]
(* multiply-val (input-nums i)))
@LispyAriaro
LispyAriaro / gist:803e5e37cb735da6dbb8
Last active September 17, 2015 01:16 — forked from flyingmachine/gist:4004807
clojure korma heroku db connection
(defdb db
(if (System/getenv "DATABASE_URL")
(let [db-uri (java.net.URI. (System/getenv "DATABASE_URL"))
user-and-password (clojure.string/split (.getUserInfo db-uri) #":")]
{:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:user (get user-and-password 0)
:password (get user-and-password 1) ; may be nil
:subname (if (= -1 (.getPort db-uri))
(format "//%s%s" (.getHost db-uri) (.getPath db-uri))
@LispyAriaro
LispyAriaro / 0_reuse_code.js
Created January 5, 2016 09:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@LispyAriaro
LispyAriaro / gist:ee5eea83a0df359e4989ae51d68c058d
Created April 9, 2016 07:50
VLC plugin - delete currently playing file
--[[
INSTALLATION (create directories if they don't exist):
- put the file in the VLC subdir /lua/extensions, by default:
* Linux (all users): /usr/share/vlc/lua/extensions/
* Linux (current user): ~/.local/share/vlc/lua/extensions/
* Mac OS X (all users): /Applications/VLC.app/Contents/MacOS/share/lua/extensions/
* Windows: not supported - getting permission error on delete...
- Restart VLC.
]]--
@LispyAriaro
LispyAriaro / Mist.md
Created May 2, 2016 15:56 — forked from jamii/Mist.md
Mist: an open-source clojure library for p2p NAT traversal, dynamic addressing and pubsub

About

Building decentralised services is an exercise in accidental complexity. Connectivity is the first hurdle. Users move around, go on- and off-line and lurk behind NAT. For centralised systems we have ICE. For decentralised systems there is no standard solution.

Mist will take an abstract address representing a user, locate their machine, punch a hole and return a local UDP proxy to talk to that user. It will be cross-platform, provide a simple api and be easy to use with existing UDP programs.

As a bonus, the implementation also provides a p2p pubsub system.

The design is based heavily on Jeremy Miller's telehash protocol (although simplified and streamlined) and draws ideas from libswift. It is also based on lessons learned from my telehash implementation.