Skip to content

Instantly share code, notes, and snippets.

freenode, #starbound:
11:30 < ^7heo> Eyes: python -c "import os; os.system('; '.join(('ffmpeg -i %s %s.mp3' % (x, x.replace('mp4','')) for x in os.listdir('.'))))"
...
11:34 < eevee> whoa
11:34 < eevee> don't use os.system
11:35 < eevee> for file in *.mp4; do ffmpeg -i $file ${file%.mp4}.mp3; done
11:35 < eevee> if you're not using zsh i highly recommend jamming some double quotes in there
@eevee
eevee / gist:6a257a9d42400e2d03f9
Last active July 26, 2018 09:18
Pokédex schema versioning problem

Schema versioning

I have some problems related to how core data in the Pokémon games has changed over time. "Time" here is a discrete quantity, where each game is a point in time.

Well actually

I just said each game is a point in time and I am lying. Many of the games come in pairs, which come out simultaneously. So Red and Blue are distinct

@trey
trey / vertical-centering-with-sass.md
Last active November 20, 2017 05:06
Vertical Centering with Sass

As a Mixin:

@mixin vertical-align {
  position: relative;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
}
@ryancdotorg
ryancdotorg / dnaas.c
Created October 30, 2013 23:20
Wrapper library to use /dev/null as a service on Linux via LD_PRELOAD
/* This is a wrapper library that will give your server the power of
* /dev/null as a service, as seen at http://devnull-as-a-service.com/
*
* Compile:
* gcc -ggdb -shared -fPIC dnaas.c -ldl -lcurl -o libdnaas.so
*
* Try:
* LD_PRELOAD=./libdnaas.so dd if=/dev/sda of=/dev/null bs=8192 count=16
*
* Install:
QMA 4 GEM 2007/01/11
IIDX GOLD GLD 2007/02/21
pop'n 15 G15 2007/04/25
Otomedius GGG 2007/11/02
DJ Troopers HDD 2007/12/19
QMA 5 HAL 2008/01/12
pop'n 16 H16 2008/03/24
Horseriders G23 2008/04/09
GFDM V5 H32/H33 2008/06/18
Empress I00 2008/11/19
@aras-p
aras-p / preprocessor_fun.h
Last active April 28, 2024 15:25
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@ryankearney
ryankearney / ComcastInject.html
Last active June 10, 2023 14:40
This is the code Comcast is injecting into its users web traffic.
<script language="JavaScript" type="text/javascript">
// Comcast Cable Communications, LLC Proprietary. Copyright 2012.
// Intended use is to display browser notifications for critical and time sensitive alerts.
var SYS_URL='/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do';
// var image_url='http://servicealerts.comcast.net:8080/images/mt';
var image_url='http://xfinity.comcast.net/constantguard/BotAssistance/notice/images';
var headertext1='<strong>Comcast Courtesy Notice</strong>';
var textline1='You have reached 90% of your <b>monthly data usage allowance</b>.';
var textline2='Please sign in for more information and to remove this alert.';
var acknowledgebutton='<a href=\"#\" onClick="document.location.href=\''+SYS_URL+'?dispatch=redirect&redirectName=login&paramName=bmUid\'" title="Sign in to acknowledge" style="color: #FFFFFF;"><img alt="Sign in to acknowledge" src="'+image_url+'/mt_signin.png"/></a>';
@Nurdok
Nurdok / python_conversion.md
Last active December 16, 2022 03:45
Python Conversion

Python Number Conversion Chart

From To Expression