Skip to content

Instantly share code, notes, and snippets.

View jamescook's full-sized avatar
🏠
Working from home

James Cook jamescook

🏠
Working from home
View GitHub Profile
require_relative "./lib/erubi.rb"
require "memory_profiler"
require "digest/md5"
erb = File.read("./template.html.erb")
report = MemoryProfiler.report do
Erubi::Engine.new(erb).src
end
require "benchmark/ips"
require "benchmark/memory"
require_relative "lib/message_bus.rb"
str = "1|1|/foo|{\"data\":\"םוֹלשָׁ\",\"user_ids\":null,\"group_ids\":null,\"client_ids\":null}".freeze
Benchmark.ips do |b|
b.report("decode1") do
MessageBus::Message.decode(str)
end
require "benchmark/ips"
$LOAD_PATH.push File.expand_path("./lib")
require_relative "./lib/arbre.rb"
if ENV['SECOND_RUN']
class ::Arbre::Element
include BuilderMethods
attr_reader :arbre_context
def initialize(arbre_context = Arbre::Context.new)
require "benchmark/ips"
$LOAD_PATH.push File.expand_path("./lib")
require_relative "./lib/arbre.rb"
if ENV['SECOND_RUN']
class ::Arbre::Context < ::Arbre::Element
def initialize(assigns = nil, helpers = nil, &block)
assigns = (assigns || {}).symbolize_keys!
@_assigns = assigns
missing =CSV.read("/home/deploy/missing_debits_from_june8th.csv");nil
key= BunchBall.session_key
start_date = Time.parse("2015-06-01").to_i
end_date = Time.parse("2015-06-30").to_i
missing.shift #user_id, debit
#125672
def get_all_history(options)
params = {
:method => 'user.getPointsHistory',
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code
require 'mechanize'
URL_FILE = "qc_urls"
OUTPUT_FILE = "qc_urls_out"
class QuantcastCrawler
def initialize(file_path, output_path)
@file_path = file_path
@output_path = output_path
end
diff --git a/Procfile b/Procfile
new file mode 100644
index 0000000..125d0f9
--- /dev/null
+++ b/Procfile
@@ -0,0 +1 @@
+unicorn: exec bundle exec unicorn_rails -c config/unicorn.rb -D
diff --git a/config/deploy.rb b/config/deploy.rb
index 180bf39..2a77bb7 100644
--- a/config/deploy.rb
diff --git a/app/assets/apps/web/appointment_booking/controllers/appointment_chooser.js b/app/assets/apps/web/appointment_booking/controllers/appointment_chooser.js
index 15027c9..32db08c 100644
--- a/app/assets/apps/web/appointment_booking/controllers/appointment_chooser.js
+++ b/app/assets/apps/web/appointment_booking/controllers/appointment_chooser.js
@@ -335,6 +335,7 @@
apptTime.setSeconds(secondsOffset);
this.appointments.push({
+ remoteAppointmentSlotId: 42,
dateTime: formatDate(apptTime, "yyyy-mm-dd hh:MM tt"),