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 'openssl' | |
require 'base64' | |
require 'digest' | |
SECRET_KEY = "9qVrrCk/9OtL5tD9fLASOtFQvbDo74oRh6JUeb0zprQ" | |
ACCESS_KEY = "PXCXJJK6N7T3S4HSDKQH" | |
request_timestamp = Time.now.utc | |
canonicalRequest = "" |
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
upstream ht_front_end { | |
server 0.0.0.0:3000; | |
server 0.0.0.0:3001; | |
server 0.0.0.0:3002; | |
server 0.0.0.0:3003; | |
} | |
server { | |
listen 80; | |
server_name hemptemps.com; |
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
["bars", "flag", "caret-down", "flag", "diamond", "camera-retro", "hand-spock-o", "ship", "venus", "file-image-o", "spinner", "check-square", "credit-card", "pie-chart", "won", "file-text-o", "arrow-right", "play-circle", "github", "medkit", "caret-down", "flag", "envelope", "search", "glass", "music", "search", "envelope-o", "heart", "star", "star-o", "user", "film", "th-large", "th", "th-list", "check", "times", "search-plus", "search-minus", "power-off", "signal", "cog", "trash-o", "home", "file-o", "clock-o", "road", "download", "arrow-circle-o-down", "arrow-circle-o-up", "inbox", "play-circle-o", "repeat", "refresh", "list-alt", "lock", "flag", "headphones", "volume-off", "volume-down", "volume-up", "qrcode", "barcode", "tag", "tags", "book", "bookmark", "print", "camera", "font", "bold", "italic", "text-height", "text-width", "align-left", "align-center", "align-right", "align-justify", "list", "outdent", "indent", "video-camera", "picture-o", "pencil", "map-marker", "adjust", "tint", "pencil-square-o", |
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 upgrade | |
\curl -sSL https://get.rvm.io | bash -s stable --rails | |
rvm install ruby 1.9 --default | |
sudo apt-get install build-essential libsdl2-dev libsdl2-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile-dev libiconv-hook-dev libxml2-dev freeglut3 freeglut3-dev ImageMagick libmagickwand-dev | |
gem install faster_xml_simple | |
gem install gosu releasy texplay ashton gamebox chipmunk ruby-opengl rmagick |
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
#<PayPal::SDK::REST::DataTypes::Payment:0x00000008053310 @error=nil, @intent="sale", @payer=#<PayPal::SDK::REST::DataTypes::Payer:0x00000008052f78 @error=nil, @payment_method="credit_card", @funding_instruments=[#<PayPal::SDK::REST::DataTypes::FundingInstrument:0x0000000804ee28 @error=nil, @credit_card=#<PayPal::SDK::REST::DataTypes::CreditCard:0x0000000804ece8 @error=nil, @type="visa", @number="4111111111111111", @expire_month=1, @expire_year=2017, @cvv2="123", @first_name="Tyrel", @last_name="Richey", @billing_address=#<PayPal::SDK::REST::DataTypes::Address:0x0000000804dff0 @error=nil, @line1="12345 Fake St.", @city="Denver", @state="Colorado", @postal_code="80229", @country_code="US">>>]>, @transactions=[#<PayPal::SDK::REST::DataTypes::Transaction:0x0000000804d398 @error=nil, @amount=#<PayPal::SDK::REST::DataTypes::Amount:0x0000000804d258 @error=nil, @total="458.00", @currency="USD">, @description="Online course payment">], @request_id="5d0f973c-cdd6-435a-830b-67e10027e6e3", @header={}> |
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 Transaction < ActiveRecord::Base | |
attr_accessor :card_number, :card_expiration_date, :card_cvv, :card_street_address, :card_city, :card_state, :card_zipcode, :is_online_cc | |
has_one :student_cart | |
belongs_to :student | |
belongs_to :user | |
include PayPal::SDK::REST | |
def submit_to_paypal | |
@payment = Payment.new({ | |
:intent => "sale", | |
:payer => { |
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
:s#_\(\l\)#\u\1#g |
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
#include <iostream> | |
using namespace std; | |
int count_x(char* p, char x) { | |
if (p==nullptr) return 0; | |
int count = 0; | |
for (; *p!=0; ++p) | |
if(*p==x) | |
++count; | |
return count; |
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 OvsmSoundManager | |
constructor: -> | |
@sounds = [] | |
sound: (id, sound) -> | |
{ id: id, sound: sound } | |
add_sound: ( id, url ) -> | |
sound = soundManager.createSound({}, url) | |
@sounds.push( @sound(id, sound) ) | |
sound_for_id: (id) -> | |
@sounds.filter( (sound) -> |
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
jQuery -> | |
if $("#map").size() > 0 | |
map = L.map('map').setView([30, 0], 3) | |
map.fitBounds([[-90, -180],[90, 180]]) | |
cloud_made = | |
api_key: 'thekey' | |
style_id: '92877' | |
tile_size: '256' | |
minZoom: 3 |
NewerOlder