Skip to content

Instantly share code, notes, and snippets.

View corydolphin's full-sized avatar

Cory Dolphin corydolphin

View GitHub Profile
@corydolphin
corydolphin / dabblet.css
Created December 13, 2012 14:49
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
font-family: Helvetica, Arial, sans-serif;
font-size:90pt;
}
@corydolphin
corydolphin / FixNature.com.js
Last active December 12, 2015 00:28
Reading textbooks on nature.com sucks. They try and force you to open everything in the same window and every link invokes a JS function. This Gist contains the JS I use in a userscript to improve the readability, and can be found in the chrome store: https://chrome.google.com/webstore/detail/naturecom-readability-imr/caehidepagpmhcgajebpggaldjl…
var myFun = function(){
for(var nl = document.querySelectorAll(".nlsInlineLinksGrey.expand"), i=0; i < nl.length; i++){
nl[i].click();
};
for(var nl = document.querySelectorAll(".nlsInlineLinks.toWrapLongWord"), i=0; i < nl.length; i++){
nl[i].href = "http://www.nature.com/principles/ebooks/sci1210-principles-of-modern-biology-15577452/" + nl[i].href.replace(/[^\d]/g, "");
};
window.addEventListener("keydown", function(event) {
if (!event){event = window.event;}
@corydolphin
corydolphin / findVisualStudioVersion.py
Created February 6, 2013 15:48
Find the version of VisualStudio installed on Windows using python
'''
:platform: Windows
:synopsis: Finds the current version of VisualStudio installed, supporting
Visual Studio 2005 to Visual Studio 2012 (and pretend support for 2014,
if versioning conventions continue).
.. moduleauthor:: Cory Dolphin <wcdolphin@gmail.com>
From:http://www.mztools.com/articles/2008/MZ2008003.aspx
To detect which Visual Studio versions (2005, 2008, etc.) are installed on a computer from a setup, you can use the following Windows registry entries (or the ones in the next section):
@corydolphin
corydolphin / subl.bat
Created February 11, 2013 01:01
Simple batch script to make using sublime text on windows even better, allows opening of sublime text in the current directory, and as a parameter. Save somewhere on your path, or add to your path.
@ECHO OFF
:: Written by Cory Dolphin (@wcdolphin www.corydolphin.com)
:: Simple batch script to make using sublime text on windows even better
:: Usage: subl [file <default=current directory>]
set sublime_path=C:\Program Files\Sublime Text 2\sublime_text.exe
if "%1" =="" ( :: no parameter, open current directory
START "" "%sublime_path%" %CD%
@corydolphin
corydolphin / server.bat
Created March 3, 2013 23:55
Create simple HTTP Server as .bat script. Put it somewhere on your path, and simply type ```server [port=8000]``` to spin up a web server.
@ECHO OFF
:: Written by Cory Dolphin (@wcdolphin www.corydolphin.com)
:: Simple bat script to start a simple Python server in the current directory
:: Usage: server [port <default = 8000>]
if "%1" =="" ( :: no parameter, default port
python -m SimpleHTTPServer 8000
) else ( :: use specified port
python -m SimpleHTTPServer %1

this should be a mention @wcdolphin

@corydolphin
corydolphin / craigslist.js
Created May 2, 2013 01:17
Parse Craigslist page for description, title, images, location, postTime, using cheerio and requests, Node.js
var cheerio = require('cheerio')
, request = require('request');
var example_url = 'http://boston.craigslist.org/gbs/sub/3779053559.html';
var parsePage = function(url, callback){
request(url, function(err, resp, body) {
if (err){
callback(err);
return
@corydolphin
corydolphin / count_github_contributions.py
Created June 22, 2013 16:48
Count Github contributions by a single user to a particular organization.
from github import Github, EmptyRepositoryException
import datetime
import time
import argparse
def main(username, password, organization):
g = Github(username, password, timeout=1)
org = g.get_organization(organization)
file_set = set()
My parents impressed on me the value of that you work hard for what you want in life. That your word is your bond and you do what you say and keep your promise. That you treat people with respect. Show the values and morals in in the daily life. That is the lesson that we continue to pass on to our son.
We need to pass those lessons on to the many generations to follow. [Cheering] Because we want our children in these nations to know that the only limit to your achievement is the strength of your dreams and your willingness to work for them.
My parents impressed on me the value of that you work hard for what you want in life. That your word is your bond and you do what you say and keep your promise. That you treat people with respect. Show the values and morals in in the daily life. That is the lesson that we continue to pass on to our son.
We need to pass those lessons on to the many generations to follow. [Cheering] Because we want our children in these nations to know that the only limit to your achievement is the strength of your dreams and your willingness to work for them.