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 'middleman/rack' | |
def ratelimit | |
return false | |
end | |
class XNS | |
def call(env) | |
ratelimit(env) or return |
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
Fetching gem metadata from https://rubygems.org/......... | |
Resolving dependencies... | |
Bundler could not find compatible versions for gem "tzinfo": | |
In Gemfile: | |
eventbrite (>= 0) ruby depends on | |
tzinfo (~> 0.3.22) ruby | |
rails (= 4.2.0.beta1) ruby depends on | |
activesupport (= 4.2.0.beta1) ruby depends on | |
tzinfo (1.2.2) |
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
var dispatcher = new WebSocketRails('localhost:3000/websocket'); | |
var channel = dispatcher.subscribe('test'); | |
channel.bind('test', function(data) { console.log("hello ws"); }); |
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
# someone posted their homework on #ruby with a terrible answer from some blog | |
# challenge accepted, so here's my answer (didn't spoiler them tho ;) | |
# Greed is a dice game where you roll up to five dice to accumulate | |
# points. The following "score" function will be used to calculate the | |
# score of a single roll of the dice. | |
# | |
# A greed roll is scored as follows: | |
# |
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
redis_config = YAML.load_file(File.join(Rails.root, 'config/redis.yml'))[Rails.env] | |
REDIS_MQTT_DB = ConnectionPool::Wrapper.new(size: redis_config['pool'], timeout: 3) do | |
Redis.new(:host => redis_config['host'], :port => redis_config['port'], :db => redis_config['mqtt_db']) | |
end | |
REDIS_SESSION_DB = ConnectionPool::Wrapper.new(size: redis_config['pool'], timeout: 3) do | |
Redis.new(:host => redis_config['host'], :port => redis_config['port'], :db => redis_config['session_time_db']) | |
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 Foo | |
def a | |
4 | |
end | |
def self.cached(key, &block) | |
define_method key.to_s do | |
self.a + yield | |
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
#!/bin/sh | |
xinput --set-prop 'Logitech M510' 'Device Accel Constant Deceleration' 3 | |
xinput --set-prop 'Logitech Gaming Mouse G400' 'Device Accel Constant Deceleration' 3 | |
xinput --set-prop 'Microsoft Comfort Mouse 6000' 'Device Accel Constant Deceleration' 3 | |
xinput --set-prop 'Microsoft Microsoft 5-Button Mouse with IntelliEye(TM)' 'Device Accel Constant Deceleration' 1.5 | |
xinput --set-prop 'USB Optical Mouse' 'Device Accel Constant Deceleration' 3 | |
xinput --set-prop 'Logitech Unifying Device. Wireless PID:1025' 'Device Accel Constant Deceleration' 2 |
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
watchdog: wdt@2004c000 { | |
compatible = "rockchip,watch dog"; | |
reg = <0xff800000 0x100>; | |
clocks = <&pclk_pd_alive>; | |
clock-names = "pclk_wdt"; | |
interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>; | |
rockchip,irq = <0>; | |
rockchip,timeout = <2>; | |
rockchip,atboot = <1>; | |
rockchip,debug = <0>; |
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
==> fs (compile) | |
Compiled src/fs_event_bridge.erl | |
Compiled src/fs_server.erl | |
Compiled src/fs.erl | |
Compiled src/sys/inotifywait_win32.erl | |
Compiled src/sys/fsevents.erl | |
Compiled src/fs_app.erl | |
Compiled src/sys/inotifywait.erl | |
Compiled src/fs_sup.erl | |
==> ranch (compile) |
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 Fleet.Endpoint do | |
use Phoenix.Endpoint, otp_app: :fleet | |
# Serve at "/" the static files from "priv/static" directory. | |
# | |
# You should set gzip to true if you are running phoenix.digest | |
# when deploying your static files in production. | |
plug Plug.Static, | |
at: "/", from: :fleet, gzip: false, | |
only: ~w(css images js favicon.ico robots.txt) |