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
Sample code for a striped Twitter Bootstrap progressbar with stripes | |
See the codepen at: http://codepen.io/SIRHAMY/pen/zqwEwv |
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
<div id="progressbar" | |
class="progress-bar progress-bar-custom | |
progress-bar-striped-custom" | |
role="progressbar" | |
aria-valuenow="70" aria-valuemin="0" | |
aria-valuemax="100" style="width: 70%;"> | |
Progress Bar Text | |
</div> |
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 json | |
#This is going to fetch our lines one-by-one | |
#Useful for super-huge files | |
class JSONFetcher(): | |
def __init__(self, fileName): | |
self.fileName = fileName + '.json' | |
def fetch(self): | |
print("fetching...") |
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 time | |
import tweetpony | |
self.twitAPI = tweetpony.API(consumer_key = env.TWITTER_CONSUMER_KEY, | |
consumer_secret = env.TWITTER_CONSUMER_SECRET, | |
access_token = env.TWITTER_ACCESS_TOKEN_KEY, | |
access_token_secret = env.TWITTER_ACCESS_TOKEN_SECRET) | |
#Abstract minefeed so you can recall it if there's an error | |
def mineFeed(self, twitterID): |
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
public class Reverser { | |
public Node reverseSLL(Node head) { | |
//To reverse: | |
//A -> B -> C | |
//A <- B <- C | |
//Save B's pointer to C | |
//Set B's pointer to A/where we came from | |
//Save pointer to B |
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 requests | |
#initial request | |
r = requests.get(requestUrl) | |
#Extract JSON | |
rJson = r.json() | |
#Get keywords key from response JSON | |
keywords = rJson.get('keywords') |
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
{ | |
"propertyKeys": [ | |
{"name": "name", "dataType": "String", "cardinality": "SINGLE"}, | |
{"name": "verified", "dataType": "Boolean", "cardinality": "SINGLE"}, | |
{"name": "tweet", "dataType": "String", "cardinality": "SINGLE"}, | |
{"name": "sentiment", "dataType": "String", "cardinality": "SINGLE"}, | |
{"name": "tone", "dataType": "String", "cardinality": "SINGLE"}, | |
{"name": "hashtag", "dataType": "String", "cardinality": "SINGLE"}, | |
{"name": "numTimes", "dataType": "Integer", "cardinality": "SINGLE"}, | |
{"name": "time", "dataType": "String", "cardinality": "SINGLE"} |
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
{ | |
"gremlin": "def g = graph.traversal(); g.V(4208)" | |
} |
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
{ "label": "user", | |
"properties": | |
{ | |
"name":"SIRHAMY", | |
"email": "[email protected]" | |
} | |
} |
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
Here, you hit the vertex endpoint, supplying VERTEX_ID in the URL. | |
DOCUMENTATION: https://ibm-graph-docs.ng.bluemix.net/api.html#vertex-apis | |
Currently, something like: | |
-HTTP: POST | |
-URL: https://ibmgraph-alpha.ng.bluemix.net/$APIURL/$GRAPHNAME/vertices/$VERTEXID | |
-BODY: update_vertex_property.json |