Skip to content

Instantly share code, notes, and snippets.

View darkone23's full-sized avatar
💭
💾☠🕸

0/∞ darkone23

💭
💾☠🕸
View GitHub Profile
- hosts: all
tasks:
- file: dest="~/foo/bar" content="baz"
# usage: ansible-playbook test.yaml -i localhost, -c local
# says ok, but
# cat ~/foo/bar

Confusion around om functionality

(defn static-data []
  (for [row (range 10)]
    {:a "some" :b "fake" :c "data"}))

(def app-state (atom {:items (static-data)}))

;;; components
@darkone23
darkone23 / list.rs
Last active January 3, 2016 07:19
how do i link list
use std::fmt::Default;
enum List<T> {
Cons(T, ~List<T>),
Nil
}
fn cons<T>(x: T, xs: List<T>) -> List<T> {
Cons(x, ~xs)
}
fn gen_closure(x: int) -> proc(int) -> int {
return proc(y: int) { x * y };
}
fn main() {
println!("{}", gen_closure(2)(3))
}
// 6
@darkone23
darkone23 / async.clj
Last active December 28, 2015 04:49
huh?
; egghead@thoth: ~/projects/clojure/async
; ~> time lein run
; => lein run 7.29s user 0.60s system 114% cpu 6.888 total
; egghead@thoth: ~/projects/clojure/async
; ~> cat output.txt | wc -l
; => 97
; egghead@thoth: ~/projects/clojure/async
; ~> cat src/async/core.clj
(ns async.core
(:require [clojure.core.async :refer (chan go-loop <! >!!)])
input {
generator {}
}
filter {
metrics {
meter => "events"
add_tag => "metric"
}
}
function template(href, text) {
return ['<a href="', href, '" target="_blank">', text, "</a>"].join('');
}
Running "nodeunit:files" (nodeunit) task
Testing linkify_test.js.............................F...........
>> test.com/"/onmouseover="alert(document.cookie)
>> Error: false == true
>> at Object.tests.(anonymous function) (tests/linkify_test.js:85:10)
@darkone23
darkone23 / gist:7274611
Created November 2, 2013 01:55
output of meatspace gruntin'
Running "jshint:all" (jshint) task
Linting routes/index.js ...ERROR
[L13:C5] W033: Missing semicolon.
})
Linting routes/index.js ...ERROR
[L132:C19] W117: 'req' is not defined.
ip: req.connection.remoteAddress,
Linting routes/index.js ...ERROR
[L133:C28] W117: 'req' is not defined.
fingerprint: req.body.fingerprint,
@darkone23
darkone23 / log4j.log
Last active December 27, 2015 05:19
does this look like it will match the way I am expecting?
31 Oct 2013 11:45:08,436 WARN [lifecycleSupervisor-1-2] (org.apache.flume.channel.file.Log.replay:442) - Checkpoint may not have completed successfully. Forcing full replay, this may take a while.
org.apache.flume.channel.file.BadCheckpointException: Configured capacity is 100000000 but the checkpoint file capacity is 1000000. See FileChannel documentation on how to change a channels capacity.
at org.apache.flume.channel.file.EventQueueBackingStoreFile.<init>(EventQueueBackingStoreFile.java:100)
at org.apache.flume.channel.file.EventQueueBackingStoreFileV3.<init>(EventQueueBackingStoreFileV3.java:49)
at org.apache.flume.channel.file.EventQueueBackingStoreFactory.get(EventQueueBackingStoreFactory.java:75)
at org.apache.flume.channel.file.Log.replay(Log.java:412)
at org.apache.flume.channel.file.FileChannel.start(FileChannel.java:301)
at org.apache.flume.lifecycle.LifecycleSupervisor$MonitorRunnable.run(LifecycleSupervisor.java:251)
at java.util.concurr
@darkone23
darkone23 / proxy.js
Last active December 27, 2015 04:59
proxy fn
function proxy(methodName) {
return function(s) {
return s[methodName].apply(this, arguments);
}
}
console.log([1,2,3].map(proxy("toString")));