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
function getHashParam(name) { | |
var regex = new RegExp("(#)("+name+")(\=)([^#]*)"), | |
matches = []; | |
matches = regex.exec(window.location.hash); | |
if (matches !== null && matches.length > 4 && matches[4] !== null) { | |
return matches[4]; | |
} else { | |
return false; | |
} | |
} |
Note: If you want to use your personal Twitter account to post commits, go to Step 2
- Create a new Twitter account for your commit messages. Example
- Go to http://dev.twitter.com and Sign In with your Twitter account you are posting commit messages to.
- Hover over your username in the top-right corner after signing in and select "My Applications"
- Create a new application
- The name, description, and site can all be whatever you want, but leave Callback URL empty
- Under "Application Settings" click "modify app permissions" next to "Access level"
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
{ | |
"name": "polymer-test", | |
"version": "0.0.1", | |
"authors": [ | |
"Vincent Agnano" | |
], | |
"license": "MIT", | |
"dependencies": { | |
"polymer": "Polymer/polymer#^1.0", | |
"google-map": "GoogleWebComponents/google-map#~1.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
#!/usr/bin/env python3 | |
p = 61 | |
q = 53 | |
n = p*q | |
phi = (p-1)*(q-1) | |
# Took from SO | |
def egcd(a, b): |
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
/** | |
* The following code will make a github embedded gists reponsive | |
* The gist will be 100% in width width, and scroll if a line is to long | |
* if you want wrapping, uncomment the wrapping section | |
* Do note that identation may be butcherd tough | |
*/ | |
.gist{ | |
width:100%; | |
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
# | |
# Original solution via StackOverflow: | |
# http://stackoverflow.com/questions/35802939/install-only-available-packages-using-conda-install-yes-file-requirements-t | |
# | |
# | |
# Install via `conda` directly. | |
# This will fail to install all | |
# dependencies. If one fails, | |
# all dependencies will fail to 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
import hashlib as hasher | |
import datetime as date | |
# Define what a Snakecoin block is | |
class Block: | |
def __init__(self, index, timestamp, data, previous_hash): | |
self.index = index | |
self.timestamp = timestamp | |
self.data = data | |
self.previous_hash = previous_hash |
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
import requests | |
from bs4 import BeautifulSoup | |
url = "http://www.azlyrics.com/lyrics/onyx/bacdafucup.html" | |
print "Default request (it will fail)..." | |
# make the default request | |
try: | |
r = requests.get(url) |
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
// Source code for the post: | |
// https://www.quora.com/Can-you-write-a-program-for-adding-10-numbers/answer/Konstantin-Tretyakov | |
// http://fouryears.eu/2018/03/17/a-program-for-adding-10-numbers/ | |
// | |
// Runs with the following config.xml: | |
// <Config> | |
// <InputProvider class="Enterprise.NumberSequenceProvider"/> | |
// <OutputConsumer class="Enterprise.PeanoNumberPrinter"/> | |
// <Solution class="Enterprise.TenNumberAddingSolution"> | |
// <Strategy class="Enterprise.AdditionStrategy"/> |
OlderNewer