brew install python --framework
pip install --upgrade distribute
This file contains hidden or 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
| # List your authorizations (substituting your own GitHub username for <user>) | |
| curl -u <user> https://api.github.com/authorizations | |
| # Update the scope of a specific authorization (substitute a specific id for <id>) to "public_repo" | |
| curl -u <user> --request PATCH https://api.github.com/authorizations/<id> --header "Content-Type:application/json" --data '{"scopes":["public_repo"]}' | |
| # Reference: http://developer.github.com/v3/oauth/#oauth-authorizations-api |
This file contains hidden or 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 https = require('https'); | |
| var util = require('util'); | |
| exports.handler = function(event, context) { | |
| console.log(JSON.stringify(event, null, 2)); | |
| console.log('From SNS:', event.Records[0].Sns.Message); | |
| var postData = { | |
| "channel": "#aws-sns", | |
| "username": "AWS SNS via Lamda :: DevQa Cloud", |
This file contains hidden or 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
| import pytest | |
| def test_spark_sanity_check(sc, tmpdir): | |
| csv = tmpdir.mkdir(__name__).join('one_liner.csv') | |
| csv.write("foo,bar,baz") | |
| data = sc.textFile(str(csv)) | |
| line_count = data.count() | |
| assert line_count == 1 |
This file contains hidden or 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
| import org.apache.commons.io.IOUtils | |
| import java.net.URL | |
| import java.nio.charset.Charset | |
| // Zeppelin creates and injects sc (SparkContext) and sqlContext (HiveContext or SqlContext) | |
| // So you don't need create them manually | |
| // load map data | |
| val myMapText = sc.parallelize( | |
| IOUtils.toString( |
This file contains hidden or 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
| <!-- place this in an %angular paragraph --> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.css" /> | |
| <div id="map" style="height: 800px; width: 100%"></div> | |
| <script type="text/javascript"> | |
| function initMap() { | |
| var map = L.map('map').setView([30.00, -30.00], 3); | |
| L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
This file contains hidden or 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/python | |
| import hmac, struct, time, base64, hashlib # for totp generation | |
| import re, sys, subprocess # for general stuff | |
| from getopt import getopt, GetoptError # pretending to be easy-to-use | |
| # | |
| # gtb - Google(auth) + Tunnelblick | |
| # |
