Skip to content

Instantly share code, notes, and snippets.

View oneross's full-sized avatar
🦕
Dinosaur Lightbulbing

oneross

🦕
Dinosaur Lightbulbing
View GitHub Profile
@oneross
oneross / MSRS_Strip_HTML
Created June 12, 2013 12:42
Regex strip of HTML elements from a text field for Microsoft Reporting Services expression. Useful for stripping formatting elements from rich text fields surfaced through MSRS from SharePoint.
= System.Text.RegularExpressions.Regex.Replace(Fields!Description.Value, "<[^>]+>","")
@oneross
oneross / scrape.py
Created October 18, 2013 01:50
Python scraper for SCPD videos, via scpd.stanford.edu portal
#!/usr/bin/env python
import re
import os
import getpass
import mechanize
import cookielib
from BeautifulSoup import BeautifulSoup
from multiprocessing import Pool
@oneross
oneross / heatmap
Last active December 28, 2015 13:29
"""Plots a Pandas dataframe as a heatmap"""
import matplotlib as mpl
import matplotlib.pyplot as plt
def heatmap(df,
edgecolors='w',
cmap=mpl.cm.gist_stern,
log=False):
width = len(df.columns)/4
height = len(df.index)/4
@oneross
oneross / gist:9991011
Created April 5, 2014 11:53
SublimeText Keybinding - Tab Indent/Unindent
[
{"keys": ["tab"], "command": "indent"},
{"keys": ["shift+tab"], "command": "unindent"}
]
> TITLE: quix.txt
> GITHUB: https://gist.githubusercontent.com/Oneross/fcbf78771de51260104a/raw/quix.txt
> MORE: http://quixapp.com
> UPDATED: 2014-05-06
bit javascript:var%20e=document.createElement('script');e.setAttribute('language','javascript');e.setAttribute('src','http://bit.ly/bookmarklet/load.js');document.body.appendChild(e);void(0); Make a bit.ly link
cal javascript:var%20s;if(window.getSelection){s=window.getSelection();}else{s=document.selection.createRange().text;}var%20t=prompt('Please%20enter%20a%20description%20for%20the%20event',s);if(t){void(window.open(encodeURI('http://www.google.com/calendar/event?ctext='+t+'&action=TEMPLATE&pprop=HowCreated%3AQUICKADD'),'gcal'));}else{void(s);} Add event to Google Calendar
clip http://cl1p.net/%s Make a new cl1p.net page from keyword
down http://downforeveryoneorjustme.com/%d Is this site downforeveryoneorjustme?
eye javascript:void(window.open('http://tineye.com/s
<html>
<head>
<title>
Simple example of an HTML document
</title>
</head>
<body>
<P>
Information to be displayed is located here.
This will be displayed as paragraph 1.
ross@LaForge ~ % defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
ross@LaForge ~ % defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
ross@LaForge ~ % defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
ross@LaForge ~ % defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false
ross@LaForge ~ % sudo pmset -a standbydelay 86400
Password:
ross@LaForge ~ % defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
ross@LaForge ~ % ls
Applications Downloads Music
@oneross
oneross / raspi_crontab.txt
Created April 10, 2020 17:15
Crontab for Raspberry Pi running Octopi, just to keep a tab on things
# date, uptime, CPU temp, voltage related events from kernal log, on the hour every hour
1 * * * * date >> vitals.log && uptime >> vitals.log && /opt/vc/bin/vcgencmd measure_temp >> vitals.log && (journalctl -k --since=-1h | grep -i voltage) >> vitals.log && echo " " >> vitals.log
@oneross
oneross / word_finder.py
Created April 15, 2020 23:48
Word Finder
#!/usr/bin/env python3
# Function to print words which can be created using a given set of characters
# Inspired by https://www.geeksforgeeks.org/possible-words-using-given-characters-python/
# Improved for use in an online puzzle by me!
# CHANGE 2020-0415: Added click for argument handling, added comments.
import click
def possible_words(lwords, charSet):
@oneross
oneross / test.gcode
Created April 16, 2020 01:53
test gist gcode
This file has been truncated, but you can view the full file.
;FLAVOR:Marlin
;TIME:4785
;Filament used: 2.1813m
;Layer height: 0.16
;MINX:88.451
;MINY:88.855
;MINZ:0.12
;MAXX:146.55
;MAXY:146.928
;MAXZ:19.96