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 SECTION === | |
import XMonad | |
-- import XMonad.Config.Gnome | |
import qualified XMonad.StackSet as W | |
import XMonad.Util.EZConfig (additionalKeys) | |
import qualified Data.Map as M | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Prompt | |
import XMonad.Prompt.Shell |
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
class BaseCollection | |
include Mongoid::Document | |
aggregate(:daily, | |
map: %Q(function() { | |
var key = { | |
year_day: this.year_day, | |
year_week: this.year_week, | |
year_month: this.year_month | |
}; |
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
defmodule DSL do | |
defmacro extend_struct struct_mod, keyword do | |
quote do | |
defstruct Keyword.merge(Map.to_list(Map.from_struct(unquote(struct_mod).__struct__)), unquote(keyword)) | |
end | |
end | |
end |
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
class Manager | |
@injects 'Task', 'Store', '...' | |
constructor: -> | |
$http.get('/tasks').success (data)-> | |
# works for nested resources too | |
Store.tasks.push new Task(item) for item in data | |
class Store | |
constructor: -> |
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
def enqueued_resources_for(klass, resource_type: nil) | |
jobs = enqueued_jobs.find_all { |_job| _job[:job] == klass } | |
resources = jobs.map {|job| | |
gid = job[:args].first['_aj_globalid'] | |
gid && GlobalID::Locator.locate(gid) | |
} | |
if resource_type | |
resources = resources.find_all { |resource| resource.is_a?(resource_type) } | |
end |
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
GenStage.async_subscribe(node, to: other) |
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
pip install h5py | |
Collecting h5py | |
Downloading h5py-2.6.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.5MB) | |
100% |████████████████████████████████| 4.5MB 152kB/s | |
Collecting numpy>=1.6.1 (from h5py) | |
Downloading numpy-1.11.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.9MB) | |
100% |████████████████████████████████| 3.9MB 176kB/s | |
Collecting six (from h5py) | |
Using cached six-1.10.0-py2.py3-none-any.whl | |
Installing collected packages: numpy, six, h5py |
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
defmodule GenstagePlayground do | |
defmodule Emitter do | |
use GenStage | |
require Logger | |
defstruct [counter: 0, demand: 0, buffer: []] | |
def add(), do: GenStage.call(__MODULE__, :in) | |
def start_link(), do: GenStage.start_link(__MODULE__, :ok, name: __MODULE__) | |
def init(:ok) do |
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
jupyer kernelspec list |
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
;; The deps.edn file describes the information needed to build a classpath. | |
;; | |
;; When using the `clojure` or `clj` script, there are several deps.edn files | |
;; that are combined: | |
;; - install-level | |
;; - user level (this file) | |
;; - project level (current directory when invoked) | |
;; | |
;; For all attributes other than :paths, these config files are merged left to right. | |
;; Only the last :paths is kept and others are dropped. |