Skip to content

Instantly share code, notes, and snippets.

@shaneog
shaneog / gist:8977948
Last active August 29, 2015 13:56 — forked from yahelc/gist:1004702
(function(){
var event_names = {
"click" : "" ,
"tweet" : "",
"retweet" : "source_tweet_id",
"follow" : "screen_name",
"favorite" : "tweet_id"
};
for(var event_name in event_names)
#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
require 'koala' # gem install koala --no-document
# create a facebook app and get access token from here
# https://developers.facebook.com/tools/explorer
# select "user_status", "friends_status", "user_checkins" when authenticating
oauth_access_token = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
graph = Koala::Facebook::API.new(oauth_access_token)
places = []
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@shaneog
shaneog / limits.sh
Created May 8, 2014 14:25
Used on Amazon Linux to set up reasonable system limits
echo "
fs.file-max = 70000" >> /etc/sysctl.conf;
DATA="* soft nofile 64000\n* hard nofile 64000\n* soft nproc 32000\n* hard nproc 32000\n\n# End of file";
DATA=`echo ${DATA} | tr '\n' "\\n"`;
sed -i "s/# End of file/${DATA}/" /etc/security/limits.conf;
echo "# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
#!/bin/bash
# bin/elb-describe-lbs | awk '{print $2}' | xargs -n1 elb-set-secure-policy.sh
ELB=$1
echo "Setting Policy on Load Balancer $1"
bin/elb-create-lb-policy $ELB \
--policy-type SSLNegotiationPolicyType \
--policy-name elb-secure-ssl \
@shaneog
shaneog / SassMeister-input-HTML.html
Created July 2, 2014 13:47
Generated by SassMeister.com.
<!doctype html>
<html>
<head></head>
<body>
<div id="header-wrapper" style="background-color: beige;">
<header class="header-grid">
<div class="page">
</div>
<!-- stars.html.erb -->
<div class="stars empty">
<div class="stars filled_<%= @obj.rating %>"></div>
</div>
<!-- stars.html.erb -->
<div class="stars empty">
<div class="stars filled"></div>
</div>
<!--
This way you can namespace your selectors.
The markup isn't as pretty, but you can
sleep soundly knowing other developers
<div class="empty">
<div class="filled"></div>
</div>