Skip to content

Instantly share code, notes, and snippets.

View asemler's full-sized avatar

Angie Semler asemler

View GitHub Profile
kill -9 $(ps aux | grep harmony | grep -v grep | awk '{print $2}')
@rafszul
rafszul / AniJS-ScrollReveal-Quick-Start.markdown
Created March 26, 2015 03:37
AniJS ScrollReveal Quick Start
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@joshcarr
joshcarr / window-height-width.js
Created July 3, 2014 00:04
vanilla JS window width and height
// vanilla JS window width and height
var w=window,
d=document,
e=d.documentElement,
g=d.getElementsByTagName('body')[0],
x=w.innerWidth||e.clientWidth||g.clientWidth,
y=w.innerHeight||e.clientHeight||g.clientHeight;
@timbergus
timbergus / server.js
Created June 19, 2013 07:43
Basic node.js server without express, returning HTML contents instead plain text.
var http = require('http');
var port = 8080;
var server = http.createServer(function(request, response) {
response.writeHead(200, {'Content-Type': 'text/html'});
response.write('<h1>Hello World!</h1>');
response.end();
});
server.listen(port, function() {
@lorenzopolidori
lorenzopolidori / has3d.js
Last active December 4, 2020 10:52 — forked from webinista/has3d.js
Testing for CSS 3D Transforms Support
function has3d(){
if (!window.getComputedStyle) {
return false;
}
var el = document.createElement('p'),
has3d,
transforms = {
'webkitTransform':'-webkit-transform',
'OTransform':'-o-transform',
@gregburek
gregburek / rateLimitDecorator.py
Created December 7, 2011 01:51
Rate limiting function calls with Python Decorators
import time
def RateLimited(maxPerSecond):
minInterval = 1.0 / float(maxPerSecond)
def decorate(func):
lastTimeCalled = [0.0]
def rateLimitedFunction(*args,**kargs):
elapsed = time.clock() - lastTimeCalled[0]
leftToWait = minInterval - elapsed
if leftToWait>0: