Skip to content

Instantly share code, notes, and snippets.

View ninetwentyfour's full-sized avatar

Travis Berry ninetwentyfour

View GitHub Profile
sponsoredItems = []
for i in data.xpath('ffed_item)
sponsored = i.xpath("div/span[@class='label--sponsored']")
if sponsored is not None:
sponsoredItems = sponsoredItems.append(i)
print(sponsoredItems)
require 'sendgrid-ruby'
include SendGrid
require 'json'
html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title></title></head><body>
<div>
<br>
<%CONTACT_SYNC_HASH%>
@ninetwentyfour
ninetwentyfour / tipbot.coffee
Last active August 29, 2015 13:56
Tipbot - Dogecoin tipping for hubot
# Description:
# Tip people with dogecoins!
# You or someone you know needs to setup and run https://github.com/ninetwentyfour/tipbot
# Only works with hipchat
# ░░░░░░░░░▄░░░░░░░░░░░░░░▄░░░░
# ░░░░░░░░▌▒█░░░░░░░░░░░▄▀▒▌░░░
# ░░░░░░░░▌▒▒█░░░░░░░░▄▀▒▒▒▐░░░
# ░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐░░░
# ░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐░░░
# ░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌░░░
@ninetwentyfour
ninetwentyfour / documents_controller.rb
Last active December 12, 2015 01:58
Simple Multi-File Uploads With Paperclip
params[:document][:filearrays].each do |file|
@document = Document.new(:document => file)
@document.save
end
@ninetwentyfour
ninetwentyfour / homebrew-update.sh
Created September 16, 2012 00:54 — forked from douglasjarquin/homebrew-update.sh
Update outdated Homebrew packages
brew upgrade `brew outdated | awk {'print $1'} | xargs`
@ninetwentyfour
ninetwentyfour / projects_controller.php
Created April 8, 2012 18:58
IndexTank To IndexDen
<?php
function add_to_index() {
$projects = $this->Project->find('all');
foreach($projects as $project){
$indexData = array('text'=>$project['Project']['title'],'title'=>$project['Project']['title'],'description'=>$project['Project']['description'],'user_id'=>$project['Project']['user_id']);
$id = $project['Project']['_id'];
$this->addIndextank("HomkoraProjects",$id,$indexData);
@ninetwentyfour
ninetwentyfour / application.html.erb
Created April 7, 2012 18:37
Real Time In Place Editing For Rails - blogpost
<script src="http://your-juggernaut-app.herokuapp.com/application.js" type="text/javascript" charset="utf-8"></script>
@ninetwentyfour
ninetwentyfour / online.rb
Created March 1, 2012 23:30
Hipchat/Play/Hubot "who's online" awesomeness
#hipchat/play/hubot who's online awesomeness
require 'sinatra'
require 'hipchat-api'
# Public: Return a string of users in hipchat
#
# Examples
#
# /online
# # => 'ninetwentyfour,kkasch,lkkadiri,p5150j'
@ninetwentyfour
ninetwentyfour / download.rb
Created March 1, 2012 19:17
Hubot Soundcloud Play
require 'sinatra'
require 'json'
require 'net/http'
require 'open-uri'
require 'taglib'
get '/download/:url' do
client_id = "your client id here"
#pass in the url to the song and resolve it to get the song ID
@ninetwentyfour
ninetwentyfour / deploy.coffee
Created February 16, 2012 21:07
Hubot Deploy 1 - blogpost
# Deploy with capistrano
#
# Usage:
# deploy <repo>
# what can you deploy?
#
hackers = [
"http://hubot-assets.s3.amazonaws.com/hackers/1.gif",
"http://hubot-assets.s3.amazonaws.com/hackers/2.gif",
"http://hubot-assets.s3.amazonaws.com/hackers/3.gif",