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
- local_action: command hostname | |
register: hostname | |
- debug: msg=hostname.stdout |
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
<?php | |
namespace MyApp\MyBundle\Listener; | |
use JMS\DiExtraBundle\Annotation as DI; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
use Symfony\Component\HttpKernel\HttpKernelInterface; | |
/** | |
* @DI\Service() |
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
config.vm.synced_folder ".", "/path/in/vm", type: "nfs", nfs_udp: false |
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
============================================================================================================================================================================= | |
Package Arch Version Repository Size | |
============================================================================================================================================================================= | |
Installing: | |
maven2 noarch 2.0.8-39.jpp6 jpackage-generic-free 5.7 M | |
Installing for dependencies: | |
ant noarch 1.8.2-5.jpp6 jpackage-generic-free 1.9 M | |
antlr noarch 2.7.7-13.jpp6 jp |
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
#!/bin/sh | |
# | |
# Drop in ~/bin/said and chmod 755 | |
# | |
# Usage: | |
# | |
# ./said 's/foo/bar/g' some/folder/* | |
# | |
find $2 -type f -exec sed -i '' $1 {} + |
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 'clojure.core.async) | |
;this is the function you want to use | |
(defn lazy-channels [chs] | |
(lazy-seq | |
(cons (first (alts!! chs)) | |
(recur chs)))) | |
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 sexp-css.core) | |
(defn- wrap [forms] (str "{" forms "}")) | |
(defn map-to-form [m] (let [outer-forms (reduce (fn [out-vec [k v]] (conj out-vec (str (name k) " : " v))) [] m) inner-forms (->> outer-forms (interpose ";") (apply str))] (wrap inner-forms))) | |
(defmacro defrule [selector & forms] `(str ~selector (apply map-to-form (vector ~@forms)))) | |
(defn px [n] (when (number? n) (str n "px"))) | |
(defn mixin [rule & forms] (merge rule (into {} forms))) | |
(def my-mixin | |
{:height "20px" | |
:width "100px"}) |
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 foo.schema | |
(:require [datomic.api :refer [tempid]])) | |
;; Datomic schema is wordy, so apply some sane defaults and allow overriding where needed. | |
(defn- attribute [ident & options] | |
(let [defaults {:db/id (tempid :db.part/db) | |
:db/ident ident | |
:db/valueType :db.type/string | |
:db/cardinality :db.cardinality/one |
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 debounce | |
([f] (debounce f 1000)) | |
([f timeout] | |
(let [id (atom nil)] | |
(fn [evt] | |
(if (not (nil? @id)) | |
(js/clearTimeout @id)) | |
(reset! id (js/setTimeout | |
(partial f evt) | |
timeout)))))) |
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
<?php | |
function f($name) | |
{ | |
return function() use ($name) { | |
return call_user_func_array($name, func_get_args()); | |
}; | |
} |
NewerOlder