Skip to content

Instantly share code, notes, and snippets.

View dannyvassallo's full-sized avatar

Dan Vassallo dannyvassallo

View GitHub Profile
@dannyvassallo
dannyvassallo / Facebook Sentiment Report RUBY
Created April 16, 2015 18:58
Facebook Sentiment Report RUBY
# Generate Acces Token Here
# https://developers.facebook.com/tools/explorer/
require 'sad_panda'
require 'httparty'
require 'json'
access_token = "*"
event_id = "[PUT THE EVENT IS HERE]"
the_url = "https://graph.facebook.com/#{event_id}/feed"
<div class="get-started-wrapper">
<div>
<div>
<form method="post" action="https://dashboard.vydia.com/service?[UTM HERE AFTER ?]">
<input type="hidden" name="service" value="[SERVICE HERE (MONETIZE OR DISTRIBUTE)]">
<input type="hidden" name="type" value="video">
<input type="hidden" name="bundle_id" value="[BUNDLE ID(s) HERE COMMA SEPARATED]">
<input type="hidden" name="networks" value="[NETWORKS HERE COMMA SEPARATED]">
<input type="hidden" name="landing_page" value="">
<input type="hidden" name="landing_section" value="">
@dannyvassallo
dannyvassallo / gist:1b94aa931d1a37e0f742
Created May 18, 2015 21:59
Get Facebook Feed from Superfan
$.ajax({
dataType: "json",
url: "http://superfan-tsm-localhost.com:3000/api/v1/facebookfeeds/5",
headers: {"X-Api-Key":"tBEPQTWZO2tArSNQ4emyagtt"} ,
success: function(data){
var feed = data["feed"]
$.each(feed, function(i, item) {
var postMessage = feed[i].message;
var postUserName = feed[i].from;
var postUserId = feed[i].id;
@dannyvassallo
dannyvassallo / Force Livereload on Middleman
Last active August 29, 2015 14:22
Force Livereload on Middleman
bundle exec middleman --force-polling --verbose
@dannyvassallo
dannyvassallo / RubyJobPrepConcepts.md
Last active August 29, 2015 14:23
Ruby Job Prep Concepts

Classes and objects (what's the difference?)

Ruby has classes but they are all implemented as objects. Some objects act as classes but some of them do not. For example "string" and String are both objects -- "string" being a String class object, and String being the class. Since classes are also objects, String is still an object while "string" is not a class -- ONLY an object.

Instantiation

To create an instance of a class, use that class's "new" method. For example, if we had a class called "Cat" we would instantiate it using the following syntax:

Cat.new
@dannyvassallo
dannyvassallo / bandsintown_scrape.js
Created August 3, 2015 20:58
Scrape Bandsintown for Date, Location, and Links
$('.events-table tr').each(function() {
var date = $(this).find('.date');
var location = $(this).find('.location');
var href = $(this).find('.more');
var link = date.find('a');
var vlink = location.find('a');
var hlink = href.find('a');
var line = link.text() + ' ' + vlink.text() + ' ' + hlink.attr('href');
document.write(line + "<br>");
});
@dannyvassallo
dannyvassallo / googlesheets.js
Last active December 10, 2015 14:22
Send Email When Drive Sheet is Reaching Cap
//*****************************************************//
// HOW TO USE //
//*****************************************************//
//1) GOTO TOOLS > SCRIPT EDITOR
//2) PASTE THIS SCRIPT INTO THE EDITOR
//3) CHANGE MAXNUM & EMAILS TO SUIT YOUR NEEDS
//4) SAVE THE SCRIPT AND NAME IT
//5) CLICK THE CLOCK ICON TO SETUP TRIGGERS
//6) ADD A TRIGGER TO SUIT YOUR NEEDS
//7) MAKE SURE YOU AUTHORIZE THE FUNCTION

To change the video, look within the index.html.

You should see a HUGE block of code with comments around it like this:

				<!-- ******************************************************************************************** -->
				<!-- ******************************************************************************************** -->
				<!-- ******************************************************************************************** -->
				<!-- ******************************************************************************************** -->
				<!-- ******************************************************************************************** -->
@dannyvassallo
dannyvassallo / SSHftp.md
Last active September 15, 2015 18:45
SSH into and FTP, Back it up, and copy the backup

#Back up your FTP site with SSH (excluding databases)

Sub in your URLs, username, and folder names. You can practically copy paste these into the terminal and it will work.


  1. SSH into the ftp and enter your password when asked:
  1. List the directories:
@dannyvassallo
dannyvassallo / allcsspositioningproperties.md
Last active September 15, 2015 23:50
All CSS Positioning Properties
Property Description Values
bottom Sets the bottom margin edge for a positioned box auto length % inherit
clip Clips an absolutely positioned element shape auto inherit
cursor Specifies the type of cursor to be displayed url auto crosshair default pointer move e-resize ne-resize nw-resize n-resize se-resize sw-resizes-resize w-resize text wait help
left Sets the left margin edge for a positioned box