Skip to content

Instantly share code, notes, and snippets.

View boogie666's full-sized avatar

Bogdan Bugarschi boogie666

  • Timisoara
View GitHub Profile
@boogie666
boogie666 / happyNewYear.js
Last active January 1, 2016 20:49
Happy New Year
var finalCountDown = (function(){
var end = new Date('01/01/2014 00:00:00'),
timer,
second = 1000,
minute = second * 60,
hour = minute * 60,
day = hour * 24;
return function(textSetter){
timer = setInterval(function() {
@boogie666
boogie666 / reset.css
Last active January 2, 2016 06:28
Reset CSS
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
@boogie666
boogie666 / .jshintrc
Created September 13, 2014 13:28
JSHint Config file
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@boogie666
boogie666 / core.clj
Last active July 13, 2020 05:33
Core logic example
(ns logical-db.core
(:require [clojure.core.logic :as l]
[clojure.core.logic.protocols :refer [walk]]
[clojure.core.logic.pldb :as db]))
; [org.clojure/clojure "1.8.0"]
; [org.clojure/core.logic "0.8.10"]
(def db { :city->zip {"City1" [1 2 3 4] "City2" [5 6]}
@boogie666
boogie666 / markov-text.clj
Last active July 11, 2017 16:13
a awesomely cool sentence generator
(ns markov-text.core
(:require [clojure.string :as str]))
(defn spliter [str]
(mapv str/lower-case (str/split str #"\s")))
(defn markov-chain [n-gram-size words]
(loop [m-chain {}
words words]
@boogie666
boogie666 / .proton
Last active September 7, 2017 22:40
Proton config
{
;; Layers you wish to have active
;; To get a list of all available layers, check github.com/dvcrn/proton/tree/master/src/cljs/proton/layers
:layers
[
;; -----------------------------------
;; core layer. Don't remove.
;; -----------------------------------
:core
@boogie666
boogie666 / screen.sh
Created April 23, 2017 17:15
resolutions
xrandr --newmode 1920x1080_60.00 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode eDP1 1920x1080_60.00
xrandr --output eDP1 --mode 1920x1080_60.00 --rate 60
@boogie666
boogie666 / html.cljs
Created May 8, 2017 15:58
Parsing Hiccup with clojure spec
(ns test.html
(:require [clojure.spec :as s]
[clojure.string :as string])
(:require-macros [cljs.spec :as s]))
(def non-closing-elements
#{:area :base :br :col :command
:embed :hr :img :input :link
:meta :keygen :param :source
:track :wbr})
@boogie666
boogie666 / fizzbuzz.clj
Last active December 5, 2017 00:18
Lazy Functional FizzBuzz in Clojure
(ns fizzbuzz.core)
(defn str-max [a b]
(if (<= (compare a b) 0) b a))
(def fizzes (cycle ["" "" "fizz"]))
(def buzzes (cycle ["" "" "" "" "buzz"]))
(def numbers (sequence (comp (map inc) (map str)) (range)))
@boogie666
boogie666 / channels.clj
Created July 9, 2017 09:52
core.async difference between pipe and pipeline
(into [] (partition-by #(not= % :spliter)) [1 2 3 4 :spliter 4 3 2 1 :spliter])
;; ^^^^ this is like the base case. output is [[1 2 3 4] [:spliter] [4 3 2 1] [:spliter]]
(def in (chan))
(def out (chan 1 (partition-by #(not= % :spliter))))
(pipe in out)