Skip to content

Instantly share code, notes, and snippets.

Ryan Angilly ryana

Block or report user

Report or block ryana

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View rvm.txt
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable
@ryana
ryana / commands.sh
Created Jul 21, 2013
Monkey patch Sprockets so that non-digest assets will be generated when ENV['SPROCKETS_NON_DIGEST'] is present
View commands.sh
# Run locally
$ SPROCKETS_NON_DIGEST=true RAILS_ENV=production rake assets:precompile
# Heroku setup
$ heroku labs:enable user-env-compile
$ heroku config:add SPROCKETS_NON_DIGEST=true
@ryana
ryana / README.md
Created Jun 24, 2016
Getting real tired of your shit, referrer spammers
View README.md

Wat

I started seeing a ton of referrer traffic from monetizationking.net. If you fill out the form, it redirects you to adzos.com.

I'm real sick of referrer spam, so let's give them a taste.

In this example, I got Adzos' GA URL:

Adzos

@ryana
ryana / url_regex.rb
Created Aug 8, 2011
@gruber's improved regex for matching URLs written in Ruby
View url_regex.rb
# From @gruber http://daringfireball.net/2010/07/improved_regex_for_matching_urls
UrlRegex = /\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/?)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s\`!()\[\]{};:\'\".,<>?«»“”‘’]))/i
@ryana
ryana / generate_url.rb
Last active May 25, 2016
ChartURL / Knowtify.io Integration Example
View generate_url.rb
# Must install the `typhoeus` gem for this example.
require 'typhoeus'
# These dependencies work for Ruby 2.1.2. Earlier versions of
# Ruby may need different requires or gems
require 'json'
require 'openssl'
require 'base64'
require 'cgi'
@ryana
ryana / application.js.coffee
Created Aug 27, 2014
Pretty spotlighting for shepherd.js
View application.js.coffee
Shepherd.on 'show', (o) ->
el = $(o.step.options.attachTo.element).first()
width = el.outerWidth() + 10
height = el.outerHeight() + 10
offset = el.offset()
$('.shep-overlay').show().css({
position: 'absolute',
width: width,
height: height,
@ryana
ryana / config.js
Created Mar 8, 2016
y2 axis format example
View config.js
{
options: {
data: {
axes: {
"data1": 'y',
"data2": 'y2'
},
},
axis: {
y2: {
@ryana
ryana / buffer_schedule.rb
Created Feb 29, 2016
buffer-schedule: Schedule all yer updates
View buffer_schedule.rb
require 'optparse'
require 'csv'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: buffer_schedule.rb [file.csv] [options]"
opts.on("-tTYPE", "--type=TYPE", "Type: twitter, facebook, linkedin") do |type|
options[:type] = type
end
@ryana
ryana / signed_url.rb
Created Jan 26, 2016
Example of creating a signed image chart URL for ChartURL.com
View signed_url.rb
# This is a working example.
require 'json'
require 'openssl'
require 'base64'
require 'cgi'
ENCRYPT_KEY = "dek-d7a46236eda961a6c3c18ffcc6b077ba87d27e9ae85f7842c6d427c265dd5f69d5131308d93332353d4a55a4b1160fcf516515a4a9f0aa50fbf2d7a2e7d0f1c5"
PROJECT_TOKEN = "dt-RwYN"
def charturl_url(template_slug, options)
@ryana
ryana / push_to_knowtify.rb
Created Dec 2, 2015
ChartURL / Knowtify.io Integration Example Part 2
View push_to_knowtify.rb
# Part 1 at https://gist.github.com/ryana/7e64954d8dd15c858f30
def push_data_to_knowtify
api_token = "SEKRIT"
headers = {'Authorization' => "Token token=#{api_token}", 'Content-Type' => "application/json"}
url_base = "http://www.knowtify.io/api/v1"
endpoint = "/contacts/upsert"
data = {
contacts: [
{
You can’t perform that action at this time.