This file contains hidden or 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
| --[[ | |
| 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. | |
| ]]-- |
This file contains hidden or 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or 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
| (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)) |
This file contains hidden or 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
| (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))) |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| 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} |
This file contains hidden or 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
| 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} |
This file contains hidden or 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
| 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' |
This file contains hidden or 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
| (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)) |
This file contains hidden or 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
| ;How to count all occurrences of 42? | |
| (count (filter #{42} coll)) | |
| ;How to express count using reduce? | |
| (defn my-count [coll] (reduce (fn [n _] (inc n)) 0 coll)) | |
| ;How to count all occurrences of 42 using reduce? | |
| (reduce (fn [n _] (inc n)) 0 (filter #{42} coll)) | |
| ;Can you get rid of the filter? |