Skip to content

Instantly share code, notes, and snippets.

View zaiste's full-sized avatar
🌀
Loading...

Jakub Neander zaiste

🌀
Loading...
View GitHub Profile
@zaiste
zaiste / foo.clj
Last active August 29, 2015 13:57
(defn news-list-view [app owner opts]
(reify
om/IInitState
(init-state [_]
{:star (chan)})
om/IWillMount
(will-mount [_]
(let [star (om/get-state owner :star)]
(go (loop []
(let [news-item (<! star)]
@zaiste
zaiste / java.yml
Created May 25, 2014 15:21
Ansible
- name: Add Oracle Java PPA
apt_repository: repo='ppa:webupd8team/java'
- name: Accept Oracla Java license
shell: echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
- name: Install Oracle Java 7 and Maven
apt: pkg=oracle-java8-installer update_cache=yes state=installed
- name: Set Oracle Java 7 JAVA_HOME environment variable
@zaiste
zaiste / java.txt
Created May 25, 2014 15:34
How to install Java on Ubuntu/Debian
apt-get install default-jre
apt-get install default-jde
apt-get install openjdk-7-jre
apt-get install openjdk-7-jdk
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java7-installer
;; works
(let [{a :a b :b} {:a 1 :b 2}]
a)
;; doesn't work
(let [(zipmap (map #(symbol (name %)) [:a :b]) [:a :b])
{:a 1 :b 2}]
a)
;; doesn't work
@zaiste
zaiste / step1
Last active August 29, 2015 14:04
PUT /wizards
{
"mappings": {
"wizard": {
"properties": {
"birthdate": {
"type": "date",
"format": "dateOptionalTime"
},
"location": {
# works
POST /movies/movie/_search
{
"query" : {
"match" : {
"inventory" : "MPA"
}
}
}
id device_type clicks created_at
1 Android 646 2014-08-13
2 iPhone 378 2014-08-13
3 Android 291 2014-08-13
4 iPhone 563 2014-08-11
5 Android 353 2014-08-13
6 iPhone 958 2014-08-13
7 Android 935 2014-08-11
8 Android 313 2014-08-13
9 iPhone 782 2014-08-13
@zaiste
zaiste / core.cljs
Created November 30, 2014 20:05
ClojureScript structure
(ns zaba.core)
(enable-console-print!)
(defn on-click []
(js/alert "Hello, World!"))
(.addEventListener (.getElementById js/document "button")
"click" on-click)
@zaiste
zaiste / boo.slim
Last active August 29, 2015 14:10
.articles-lg
article.boo
p
' #{t 'index.customize_the_'}
span = t 'index.your_logo'
@zaiste
zaiste / redis.go
Created December 4, 2014 09:40
Using Redis in Go
package main
import (
"fmt"
"github.com/garyburd/redigo/redis"
)
func main() {
c, err := redis.Dial("tcp", ":6379")
if err != nil {