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 request = require("request"); | |
var options = { | |
method: 'POST', | |
url: 'https://trackcmp.net/event', | |
headers: { | |
//Add Headers here if needed | |
}, | |
form: { | |
actid: 23033, | |
key: "c12973b078007927842301eff932e7d78b74b3e", |
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 request = require("request"); | |
var options = { | |
method: 'POST', | |
url: 'https://trackcmp.net/event', | |
headers: { | |
//Add Headers here if needed | |
}, | |
json: { | |
actid: 23033, | |
key: "c12973b078007927842301eff932e7d78b74b3e", |
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
node_layers = node[:opsworks][:instance][:layers] | |
if (node_layers.include?("rails-app")) | |
node[:deploy].each do |application, deploy| | |
Chef::Log.debug("Trying rake for application #{deploy[:application_type]}") | |
if defined?(deploy[:application_type]) && deploy[:application_type] != 'rails' | |
Chef::Log.debug("Skipping Rollbar non rails apps") | |
next | |
end | |
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
worker_processes 1; | |
error_log /usr/local/etc/nginx/logs/error.log debug; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; |
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
twitter_client.filter(track: hashtags.join(",")) do |tweet| | |
# Only Fetch tweets objects and ignore all retweets | |
if tweet.is_a?(Twitter::Tweet) && !tweet.retweet? | |
# only fetch tweets with images. | |
if tweet.media? | |
tweet_respresenter = Storage::Tweet.new.extend(TweetRepresenter).from_json(tweet.to_json) | |
tweet_respresenter.save!($redis) | |
print '.' | |
end |
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
[base] | |
name=CentOS-$releasever - Base | |
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch= | |
$basearch&repo=os | |
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ | |
enabled=1 | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 | |
priority=1 |
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 python | |
# -*- coding: utf-8 -*- | |
import requests | |
text = u'這是一封測試簡訊 This a test SMS.' | |
endpoint = 'https://rest.nexmo.com/sms/json' | |
data = { | |
'username': '{yours}', | |
'password': '{yours}', |
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
{ | |
"apiVersion": "1.0", | |
"data": { | |
"_id": "51cbe9e4f92f58b477000003", | |
"created_at": "2013-06-27T10:29:40+03:00", | |
"description": "My Drunk Kitchen", | |
"title": "My Drunk Kitchen", | |
"updated_at": "2013-06-27T10:29:40+03:00", | |
"items": [{ | |
"video": { |
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
# Return the number of odd numbers preceding a given number | |
# usage: | |
# puts Numberofoddnumbers::get(num) | |
# puts Numberofoddnumbers::get(num, 7) # will get all the odd numbers until 7 | |
# | |
# blog post http://blog.moski.me/2012/05/drawing-hearts-in-ruby.html | |
# | |
module Numberofoddnumbers | |
def self.get(number, start_from=1) | |
sum = 0 |
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
# Draw a heart in ruby | |
# blog post http://blog.moski.me/2012/05/drawing-hearts-in-ruby.html | |
# | |
puts [[2,2],9,9,7,5,3,1].map{|t|[*t].map{|n|"*"*n}.join(" ").center(9)} |
NewerOlder