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
| require 'moneta' | |
| require 'flipper' | |
| load './lib/flipper/adapters/moneta.rb' | |
| moneta = Moneta.build do | |
| use :Logger | |
| adapter :Memory | |
| end | |
| adapter = Flipper::Adapters::Moneta.new(moneta) |
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
| content_type = request["content-type"] |
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
| require 'gruff' | |
| g = Gruff::Line.new(400) | |
| g.maximum_value = 100 | |
| g.minimum_value = 0 | |
| g.y_axis_increment = 5 | |
| g.theme = { | |
| :colors => %w(black red), | |
| :marker_color => 'grey', | |
| :font_color => 'black', |
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 Request | |
| HEADERS = { 'Content-Type' => 'application/json' }.freeze | |
| def self.add_headers(headers) | |
| HEADERS.merge!(headers) | |
| end | |
| def get_request(path) | |
| uri = URI.parse(path) | |
| http = Net::HTTP.new(uri.host, uri.port) |
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- copy-nil-vals [[k v]] | |
| (if (nil? v) | |
| {k k} | |
| {k v})) | |
| (defn column-vals [column-mappings] | |
| (->> column-mappings | |
| (map #(select-keys % [:value :mapped_value])) | |
| (map vals) | |
| (map #(apply hash-map %)) |
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
| WITH RECURSIVE tree AS ( | |
| SELECT id, ARRAY[]::INTEGER[] AS ancestors | |
| FROM test WHERE parent_id IS NULL | |
| UNION ALL | |
| SELECT test.id, tree.ancestors || test.parent_id | |
| FROM test, tree | |
| WHERE test.parent_id = tree.id |
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
| ;; project.clj | |
| ... | |
| :dependencies [[org.clojure/clojure "1.8.0"] | |
| [clj-ssh "0.5.14"]] | |
| (ns csv-loader.csv | |
| (:require [clj-ssh.ssh :as ssh])) | |
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 Foo | |
| def baz | |
| log("some msg") | |
| 2 | |
| end | |
| def bar(n) | |
| n + baz | |
| 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
| def m | |
| enum = [1,2,3].each | |
| loop do | |
| enum.next | |
| end | |
| end | |
| # m returns [1,2,3] | |
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
| <div id="player">Click ME FRITZ</div> | |
| <script> | |
| $(document).ready(function() { | |
| player = new Audio("img/songs/test.mp3"); | |
| $('#player').click(function(){ | |
| player.play(); | |
| } | |
| }); | |
| </script> |
NewerOlder