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
export VIRTUAL_ENV_DISABLE_PROMPT=1 | |
pyenv_python_version(){ | |
result="" | |
if pyenv 2>/dev/null; then | |
pyenv_version="$(pyenv version-name)"; | |
if [ -n "$pyenv_version" ]; then | |
result="$pyenv_version"; | |
fi | |
fi |
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 click | |
@click.group() | |
def main(): | |
"""Do things.""" | |
def delegate_command(group, command_name, function, args=None, kwargs=None): | |
""" | |
Takes a function that has been decorated with ``click.group`` and delegates a command to it | |
""" |
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 events = require("events"); | |
var util = require("util"); | |
Writer = function(prefix) | |
{ | |
if(typeof prefix === "undefined") | |
{ | |
this.prefix = ""; | |
} | |
else |
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
<!doctype html> | |
<html> | |
<head> | |
<title>test</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready( | |
function() { | |
$("#clicky").click(function(evt) { |
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 tarfile | |
dir = "/some/directory" | |
tar = tarfile.open(dir + "/some_file.tar.gz",'w:gz') | |
tar.add(dir + "/some_subdirectory",arcname='some_subdirectory') | |
tar.close() |
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 https = require("https"); | |
var util = require("util"); | |
var output = ""; | |
https.get("https://relevant.url.to.get.stars" | |
, function(res) { | |
res.on('data', function(d) { | |
output += d; | |
}); |
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 express = require("express"); | |
var app = express(); | |
app.all("/",function(req,res){ | |
res.writeHead(200,{"Content-Type":"text/plain"}); | |
res.end(req.headers.host); | |
}); | |
app.listen(3000); |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Marked test</title> | |
<script type="text/javascript" src="js/marked.js"></script> <!-- https://github.com/chjj/marked --> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> | |
<script type="text/javascript" src="js/jquery.textarea.js"></script> <!-- https://github.com/alanhogan/Tabby --> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$("#blah").tabby(); |
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
[n | n <- [2..100], [m | m <- [2..n-1], n `mod` m == 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
import edu.stanford.math.plex4.api.Plex4; | |
import edu.stanford.math.plex4.homology.barcodes.BarcodeCollection; | |
import edu.stanford.math.plex4.homology.chain_basis.Simplex; | |
import edu.stanford.math.plex4.homology.interfaces.AbstractPersistenceAlgorithm; | |
import edu.stanford.math.plex4.streams.impl.ExplicitSimplexStream; | |
public class BasicHomology { | |
public static void main(String[] args) { |