Skip to content

Instantly share code, notes, and snippets.

@dhrosa
dhrosa / defucker.py
Created July 2, 2016 02:49
defucker
import pprint
question = None
by_dorm = []
by_age = []
by_year = []
by_greek = []
by_gender = []
i = 0
@dhrosa
dhrosa / urls.py
Created March 8, 2016 02:23
urls
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from filebrowser.sites import site
from django.contrib import admin
admin.autodiscover()
from django.views.generic import TemplateView
@dhrosa
dhrosa / anonymous-gist.py
Created September 15, 2015 01:32
render_to_response
@internal_ip_only
class Crop(FormView):
template_name = "scan/crop.html"
form_class = CropForm
def get_context_data(self, **kwargs):
context = super(Crop, self).get_context_data(**kwargs)
context['image'] = get_object_or_404(ScannedImage, pk=self.kwargs["pk"])
return context
@dhrosa
dhrosa / apt.yml
Created September 11, 2015 23:15
ansible playbook
---
- hosts: all
tasks:
- apt: name=emacs24
- apt: name=git
- apt: name=screen
# Sync certain files in home directory between computers
- apt: name=unison
@dhrosa
dhrosa / *Org LATEX Export*
Created September 8, 2015 01:33
tex test
% Created 2015-09-07 Mon 21:33
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{rotating}
@dhrosa
dhrosa / git.org
Created August 22, 2015 20:49
Basic git commands

Basic Git Commands

Create a new repository from scratch

Create the directory for your project using mkdir

cd ~/whatever/parent/directory
mkdir my_project
cd my_project
@dhrosa
dhrosa / apt.yml
Created August 22, 2015 15:26
My ansible config
---
- hosts: all
tasks:
- apt: name=emacs24
- apt: name=git
- apt: name=screen
# Sync certain files in home directory between computers
- apt: name=unison
def find_pillar(sense):
start = 0
end = 10**9
found = False
while found == False:
mid = (start + end) / 2
up = mid + 1
down = mid - 1
eMid = sense(mid)
@dhrosa
dhrosa / 2015-06-19-##electronics.log
Created June 22, 2015 22:52
6-19 electronics logs
--- Log opened Fri Jun 19 00:00:12 2015
00:00 -!- Binky [~anmouse@2001:8b0:3e1:47:222:4dff:fe82:de0c] has joined ##electronics
00:00 -!- zulgm [~zulgm@ber19-3-78-220-252-108.fbx.proxad.net] has quit [Excess Flood]
00:00 -!- GGMethos [methos@2600:3c00::f03c:91ff:fe98:2674] has quit [Quit: WeeChat 1.3-dev]
00:01 -!- Damt [~Damt@ber19-3-78-220-252-108.fbx.proxad.net] has joined ##electronics
00:01 -!- Damt [~Damt@ber19-3-78-220-252-108.fbx.proxad.net] has quit [Excess Flood]
00:01 -!- jackbrown [~se@unaffiliated/jackbrown] has quit [Ping timeout: 250 seconds]
00:01 -!- mrec [~markus@sundtek.de] has quit [Read error: Connection reset by peer]
00:04 -!- jdbg [~jdbg@ber19-3-78-220-252-108.fbx.proxad.net] has joined ##electronics
00:04 -!- jdbg [~jdbg@ber19-3-78-220-252-108.fbx.proxad.net] has quit [Excess Flood]
(setq org-publish-project-alist
'(("blog"
:base-directory "~/blog"
:recursive t
:base-extension "org"
:html-extension "html"
:publishing-directory "~/blog/html/"
:publishing-function (org-html-publish-to-html)
:html-head (concat
"<meta charset=\"utf-8\">"