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/bash | |
# /etc/init.d/unicorn | |
# ### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $network $remote_fs $local_fs | |
# Required-Stop: $network $remote_fs $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Stop/start unicorn |
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
Manager::BookingsController#data 0.044 5,509 5062 SQL, SQL, ... | |
statement/Postgres/ActiveRecord::SessionStore::Session/find 0.045 1 1 SQL | |
statement/Postgres/Restaurant/find 0.048 1 1 SQL | |
statement/Postgres/Restaurant/find 0.051 1 1 SQL | |
statement/Postgres/Table/find 0.054 1 1 SQL | |
statement/Postgres/Reservation/find 0.062 2 2 SQL | |
statement/Postgres/Opening/find 0.066 1 1 SQL | |
statement/Postgres/Reservation/find 0.070 2 2 SQL | |
statement/Postgres/Opening/find 0.074 1 1 SQL | |
statement/Postgres/Offering/find 0.082 1 1 SQL |
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
➜ finedining-server git:(develop) docker run \ | |
> --interactive --tty --rm \ | |
> --env CODE_PATH="$PWD" \ | |
> --volume "$PWD":/code \ | |
> --volume /var/run/docker.sock:/var/run/docker.sock \ | |
> --volume /tmp/cc:/tmp/cc \ | |
> codeclimate/codeclimate analyze | |
fatal: bad config file line 1481 in .git/config | |
fatal: bad config file line 1481 in .git/config |
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
#create mango pay user (dummy) | |
user_id = begin | |
mango_user = MangoPay::NaturalUser.create({'FirstName' => 'DummyFirstName', 'LastName' => 'DummyLastName', | |
'Email' => '[email protected]', 'Birthday' => 1300186358, | |
'Nationality' => FFaker::Address.country_code, | |
'CountryOfResidence' => FFaker::Address.country_code, | |
'Tag' => "Guest of #{@restaurant.name}"}) | |
mango_user['Id'] | |
rescue SocketError => e |
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 Bookings | |
class BookingsController < ApplicationController | |
include GuestBookingSteps | |
layout 'bookings/application' | |
rescue_from Wicked::Wizard::InvalidStepError, with: :foo | |
DEFAULT_GUEST_COUNT = "2" | |
...... | |
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
# constant-time comparison algorithm to prevent timing attacks | |
def secure_compare(a, b) | |
return false if a.blank? || b.blank? || a.bytesize != b.bytesize | |
l = a.unpack "C#{a.bytesize}" | |
res = 0 | |
b.each_byte { |byte| res |= byte ^ l.shift } | |
res == 0 | |
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
sudo apt-get update | |
sudo apt-get -y install libtag1-dev autoconf automake build-essential libass-dev libgpac-dev \ | |
libsdl1.2-dev libtheora-dev libtool libvorbis-dev pkg-config texi2html zlib1g-dev -y | |
mkdir ~/ffmpeg_sources | |
#ysam | |
cd ~/ffmpeg_sources | |
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz | |
tar xzvf yasm-1.2.0.tar.gz | |
cd yasm-1.2.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
% ------- Define procedures---- | |
/inch {72 mul} def | |
/box % stack: x y => --- | |
{ newpath moveto | |
1 inch 0 rlineto 0 1 inch | |
rlineto −1 inch 0 | |
rlineto closepath } def | |
/fillbox % stack: grayvalue => --- | |
{ setgray fill } def |
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 to_dot_time(seconds) | |
hours = seconds / 3600 | |
seconds -= hours * 3600 | |
minutes = seconds / 60 | |
seconds -= minutes * 60 | |
(hours > 0 ? [hours, minutes, seconds] : [minutes, seconds]).join(":") | |
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 -e | |
### BEGIN INIT INFO | |
# Provides: resque | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: resque - a Redis-backed Ruby library for creating background jobs |