Skip to content

Instantly share code, notes, and snippets.

@efuquen
efuquen / memory.py
Last active May 7, 2021 22:21
memory.py
from sense_hat import SenseHat
import time
import random
sense = SenseHat()
#declare color tuples
r = (255,0,0)
w = (255,255,255)
k = (0,0,0)
Traceback (most recent call last):
File "manage.py", line 23, in <module>
main()
File "manage.py", line 19, in main
execute_from_command_line(sys.argv)
File "/Users/efuquen/.pyenv/versions/3.8.3/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/Users/efuquen/.pyenv/versions/3.8.3/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/efuquen/.pyenv/versions/3.8.3/lib/python3.8/site-packages/django/core/management/base.py", line 328, in run_from_argv
@efuquen
efuquen / gist:a6339132b420ac5df37f19cb541ff3a1
Created June 19, 2020 04:17
PIT migration script error
migration_1 | Operations to perform:
migration_1 | Apply all migrations: admin, auth, contenttypes, sessions, survey
migration_1 | Running migrations:
migration_1 | Applying survey.0006_auto_20200616_1856...Traceback (most recent call last):
migration_1 | File "manage.py", line 23, in <module>
migration_1 | main()
migration_1 | File "manage.py", line 19, in main
migration_1 | execute_from_command_line(sys.argv)
migration_1 | File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
migration_1 | utility.execute()
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {number[]} preorder
* @return {TreeNode}
" Installs vim-plug.
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
mport csv
import locale
import sys
locale.setlocale(locale.LC_ALL, '')
csv_filepath = sys.argv[1]
winners = []
with open(csv_filepath, 'rb') as csvfile:
@efuquen
efuquen / gist:6235987
Last active December 21, 2015 02:38
Will prepend a git commit with a user story number, which conforms to the regex "US[0-9][0-9]*", *if* the currently checked out branch ends in the user story. For example, a branch called "some-branch-name-US1234" will have all git commits starting with "US1234 - Some git commit message here". If you are in a branch that does not end in User Sto…
#!/bin/bash
CURRENT_BRANCH="$(git symbolic-ref HEAD | awk -F '\/' '{ print $NF }')"
if [[ $CURRENT_BRANCH =~ ^.*US[0-9][0-9]*$ ]]; then
STORY_ID="$(echo $CURRENT_BRANCH | sed 's/^.*\(US[0-9][0-9]*\)$/\1/')"
cat $1 | awk '{if(NR == 1) { print "'${STORY_ID}' -",$0 } else { print $0 } }' > $1.tmp
mv $1.tmp $1
fi
efuquen@ubuntest ~/Code/oss/libav (master) $ gdb ./avconv
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
@efuquen
efuquen / gist:2706664
Created May 16, 2012 01:48
Grooveshark MD5 Calculations
import java.io.*;
//Custom java md5 implementaiton, use whatever you have available, as long as you stream bytes
//into it.
import com.twmacinta.util.MD5;
public class FileHash
{
/*
import java.io.*;
//Custom java md5 implementaiton, use whatever you have available, as long as you stream bytes
//into it.
import com.twmacinta.util.MD5;
public class FileHash
{
/*