Skip to content

Instantly share code, notes, and snippets.

@spaghetti-
spaghetti- / stats.py
Created November 23, 2016 10:53
fit a random rostopic data to a distribution over time
import rospy
import rostopic
import sys
import scipy
import scipy.stats
data = []
def cb(msg, field):
field = field.strip().split('.')
@spaghetti-
spaghetti- / fetch.py
Last active November 7, 2016 21:39
script that parses out all email addresses one has sent emails to and received email from
#!/usr/bin/env python2.7
from __future__ import print_function
# some stuff that we want to use doesn't work with python3 + windows
import sys
import yaml
import imaplib
from email.parser import HeaderParser
diff -u src/init.c /tmp/src/init.c
--- src/init.c 2015-10-12 12:09:07.000000000 -0700
+++ /tmp/src/init.c 2016-11-28 12:14:40.418864596 -0800
@@ -128,12 +128,8 @@
return GL_FALSE;
}
- _glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount);
_glfwInitialized = GL_TRUE;
# required by dev-python/rosdistro-0.4.7::gentoo
# # required by dev-util/rosdep-0.11.5::gentoo
# # required by rosdep (argument)
=dev-python/catkin_pkg-0.2.10 ~amd64
# # required by dev-util/rosdep-0.11.5::gentoo
# # required by rosdep (argument)
=dev-python/rosdistro-0.4.7 ~amd64
# # required by dev-python/rosdistro-0.4.7::gentoo
# # required by dev-util/rosdep-0.11.5::gentoo
# # required by rosdep (argument)
Dump of assembler code for function bof:
0x080484ed <+0>: push %ebp
0x080484ee <+1>: mov %esp,%ebp
0x080484f0 <+3>: sub $0x68,%esp
0x080484f3 <+6>: movl $0x1,-0xc(%ebp)
0x080484fa <+13>: mov -0xc(%ebp),%eax
0x080484fd <+16>: mov %eax,-0x10(%ebp)
0x08048500 <+19>: mov 0x8(%ebp),%eax
0x08048503 <+22>: mov %eax,0xc(%esp)
0x08048507 <+26>: movl $0x40,0x8(%esp)
0x08048610 <+291>: mov 0x804a044,%eax
0x08048615 <+296>: mov 0x804a050,%ecx
0x0804861b <+302>: mov 0x804a054,%edx
0x08048621 <+308>: add %ecx,%edx
0x08048623 <+310>: cmp %edx,%eax
0x08048625 <+312>: jb 0x804858d <bof+160>
=> 0x0804862b <+318>: mov -0xc(%ebp),%eax
0x0804862e <+321>: mov %eax,0x8(%esp)
0x08048632 <+325>: mov -0x10(%ebp),%eax
0x08048635 <+328>: mov %eax,0x4(%esp)
#include <iostream>
struct FizzBuzz
{
FizzBuzz() : i(1) { delete this; }
~FizzBuzz()
{
for (; i <= 100; i++) {
if (!(i % 3)) std::cout << "Fizz";
if (!(i % 5)) std::cout << "Buzz";
else if (i % 3) std::cout << i;
@spaghetti-
spaghetti- / fix-sig.sh
Last active August 18, 2016 07:59
update homebrew formulae from sha1 to sha256
#!/bin/sh
if grep -q 'sha256' "$1"
then
echo "$1 is already up to date, not verifying."
exit 0
fi
FILE=$1
URL=`grep 'url' "$1" | cut -d' ' -f 4 | sed "s/\'//g" | sed 's/"//g'`
@spaghetti-
spaghetti- / 4ch.sh
Last active January 15, 2017 21:46
Download all images from a specified 4chan thread to disk, in parallel.
function 4get() {
curl -k -s $1 | egrep -o \
"\/\/is2\.4chan\.org\/gif\/\d+\.(webm|gif|jpeg|jpg|png)" | \
sed 's/^/https:/; s/is\d?\.4chan\.org/i\.4cdn\.org/' | uniq | \
xargs -n 1 -P 12 curl -# -O
}
$ stack --verbose --version
Version 1.0.0 x86_64
$ eix dev-haskell/stack
[I] dev-haskell/stack [1]
Available versions: ~0.1.3.1(0/0.1.3.1) ~0.1.4.1(0/0.1.4.1) ~0.1.6.0-r1(0/0.1.6.0) (~)1.0.0-r1(0/1.0.0)^t **9.9.9(0/9.9.9) {disable-git-info integration-tests}
Installed versions: 1.0.0-r1(0/1.0.0)^t(04:59:00 PM 06/20/2016)(-disable-git-info -doc -hoogle -hscolour -integration-tests -profile -test)
Homepage: https://github.com/commercialhaskell/stack
Description: The Haskell Tool Stack