This file contains 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
<script type="text/javascript"> | |
var onswipeSometimes = function() { | |
var usr = "f"; | |
var fractionToRedirect = '3/4'; | |
var parts = fractionToRedirect.split('/'); | |
var total = parseInt(parts[1]); | |
var redirect = parseInt(parts[0]); | |
var randomNumber = Math.floor(Math.random()*total + 1); // Number between 1 and total inclusive | |
if (randomNumber <= redirect) { | |
var synapse = 'http://assets.onswipe.com/synapse/on.js?usr=' + usr; |
This file contains 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
/* | |
* Receive the data from the server and draw what the other client sent | |
*/ | |
// Get current PaperScope context | |
var newScope = (function(paper, socket) { | |
console.log(this); | |
paper.install(this); | |
var originalLayer; |
This file contains 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
/* | |
* Receive the data from the server and draw what the other client sent | |
*/ | |
var socketedPaper = {}; | |
document.addEventListener('paperReady', function() { | |
paper.install(socketedPaper); | |
socketedPaper.socket = socket; | |
//socketedPaper.projects[0].activate(); | |
console.log('In redraw', socketedPaper); |
This file contains 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 mongo = require('onswipe-shared').mongo(); | |
var redis = require('./lib/redis'); // From Synapse | |
if (process.argv.length > 2) | |
{ | |
var entriesCollection = mongo.collection('entries'); | |
pid = parseInt(process.argv[2]); | |
entriesCollection.find({publisher_id: pid, source_id: null}, function(err, entries) { | |
if (err) { | |
console.log(err); |
This file contains 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
#!/usr/bin/env bash | |
if [ $ENVIRONMENT = 'development' ]; then | |
psql ayalo_dev postgres < script.sql; | |
elif [ $ENVIRONMENT = 'beta' ]; then | |
PGPASSWORD=scrubbed psql -h scrubbed --port 5432 ayalo_dev postgres < script.sql | |
elif [ $ENVIRONMENT = 'production' ]; then | |
PGPASSWORD=scrubbed psql -h scrubbed --port 5492 scrubbed scrubbed < script.sql | |
fi |
This file contains 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
/home/vagrant/.bashrc: | |
file.append: | |
- text: | |
- "set -o vi" | |
temp_cleanup: | |
file.line: | |
- name: /home/vagrant/.bashrc | |
- path: /home/vagrant/.bashrc | |
- content: "alias l='ls -liah'" |
This file contains 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
#!/usr/bin/env bash | |
# Requisito de usar este script es tener node.js instalado | |
command -v node >/dev/null 2>&1 || { echo >&2 "Se require Node.JS para ejecutar este script. Por favor instalelo (https://nodejs.org/) e ejecutelo de nuevo."; exit 1; } | |
# Crear demo directory | |
git clone https://github.com/frankpinto/scraper-demo.git | |
# Instalar dependencias | |
cd scraper-demo |
This file contains 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
task :fix_image_headers => :environment do | |
puts "---------------------------------------------" | |
puts "Uploading ad images to tools.ayalo.co" | |
puts "---------------------------------------------" | |
# Set s3 credentials | |
Dotenv.load | |
# Example of Client interface | |
s3 = Aws::S3::Client.new |
This file contains 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
"Remove broken precise PostgreSQL APT": | |
pkgrepo.absent: | |
- name: deb http://apt.postgresql.org/pub/repos/apt/ precise main | |
- dist: precise | |
- comps: main | |
"Remove precise PostgreSQL APT": | |
pkgrepo.absent: | |
- name: deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main |
This file contains 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
ENV['RAILS_ENV'] ||= 'test' | |
require File.expand_path('../../config/environment', __FILE__) | |
require 'rails/test_help' | |
class ActiveSupport::TestCase | |
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. | |
fixtures :all | |
# Add more helper methods to be used by all tests here... | |
end |
OlderNewer