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
/* | |
* Usage: | |
* getJSON("https://jsonplaceholder.typicode.com/comments", { postId: 1}) | |
* .then(data => { | |
* console.log(data); | |
* }); | |
*/ | |
function getJSON(url, qs_params) { | |
function buildQueryString(params) { |
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
:001 > require 'feedjira' | |
:002 > require './janky_parser.rb' | |
:003 > feed_url = 'https://gist.githubusercontent.com/mertonium/11087612/raw/b9402604180704d41614ddb92e1f3cdd9c09b273/janky_feed.xml' | |
# Add our custom parser to the top of the stack of feeds Feedjira uses. | |
:004 > Feedjira::Feed.add_feed_class Feedjira::Parser::Versa::JankyPublisher | |
# Fetch and parse our example feed | |
:005 > feed = Feedjira::Feed.fetch_and_parse feed_url | |
:006 > feed.class | |
=> Feedjira::Parser::Versa::JankyPublisher # Sweet! Our parser was chosen to parse the feed. |
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
class Chromedriver < Formula | |
desc "Tool for automated testing of webapps across many browsers" | |
homepage "https://sites.google.com/a/chromium.org/chromedriver/" | |
url "https://chromedriver.storage.googleapis.com/2.34/chromedriver_mac64.zip" | |
version "2.34" | |
sha256 "bc4ad903c1f85ed328726a9914fbec9d539be8eda0a5489e8dc5dd08123d28fc" | |
bottle :unneeded | |
def install |
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
# app deps | |
sudo yum install git | |
# erlang deps | |
sudo yum groupinstall "Development Tools" | |
sudo yum install ncurses-devel openssl-devel | |
# erlang | |
wget http://erlang.org/download/otp_src_20.2.tar.gz | |
tar -zxvf otp_src_20.2.tar.gz |
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 data-electnext id="enxt-script" type="text/javascript"> | |
//<![CDATA[ | |
var _enxt = _enxt || []; | |
_enxt.push(['set_account', 'YOUR_API_KEY']); | |
_enxt.push(['set_article', 'YOUR_CMS_SPECIFIC_ARTICLE_ID']); | |
_enxt.push(['setup_featured_perspective']); | |
(function() { | |
var enxt = document.createElement('script'); enxt.type = 'text/javascript'; enxt.async = true; | |
enxt.src = '//versahq.com/api/v1/enxt.js'; var k = document.getElementById('enxt-script'); |
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
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
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
# I am trying out Ratchet.io and I want to add their deployment notification to my | |
# normal capistrano deployment process. Here is my first working attempt. | |
# Add this task to your deploy.rb | |
namespace :rollbar do | |
task :notify, :roles => [:web] do | |
set :revision, `git log -n 1 --pretty=format:"%H"` | |
set :local_user, `whoami` | |
set :rollbar_token, YOUR_ACCESS_TOKEN | |
rails_env = fetch(:rails_env, 'production') |
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
<!-- User-selected issues --> | |
<script data-electnext> | |
(function() { | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.async = true; | |
script.src = 'http://electnext.com/widget/v2.js?key=dae517d92ae38ee6e8c48a23401f52a75a10b362'; | |
var entry = document.getElementsByTagName('script')[0]; | |
entry.parentNode.insertBefore(script, entry); |
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
{ | |
"_id": "appconfig", | |
"doc_type": "config", | |
"city_name": "San Francisco", | |
"brought_to_you_by": "SF Arts Commision", | |
"google_analytics": "UA-XXXXXXXX-X" | |
} |
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 csv = require('csv'), | |
cradle = require('cradle'); | |
var docs = []; | |
var successCount = 0, | |
failCount = 0, | |
curproc = 0, | |
throttle = 5; |
NewerOlder