Skip to content

Instantly share code, notes, and snippets.

View synic's full-sized avatar

Adam Olsen synic

  • Giddy
  • Salt Lake City, Utah
View GitHub Profile
0800029c <SetSysClock>:
800029c: b480 push {r7}
800029e: b083 sub sp, #12
80002a0: af00 add r7, sp, #0
80002a2: 2300 movs r3, #0
80002a4: 607b str r3, [r7, #4]
80002a6: 2300 movs r3, #0
80002a8: 603b str r3, [r7, #0]
80002aa: 4b21 ldr r3, [pc, #132] ; (8000330 <SetSysClock+0x94>)
80002ac: 2213 movs r2, #19
#!/usr/bin/env python
import os, sys
sys.path.append(os.getcwd())
import logging
import rq
MAX_FAILURES = 3
class OAuth2Authentication(authentication.OAuth2Authentication):
def authenticate(self, request):
valid_request = super(OAuth2Authentication, self).authenticate(request)
is_valid = valid_request is not None
"""
This is a test
* this line is a line, and it's really long and it should wrap, but because
it's a bulleted list, it should be indented.
"""
@synic
synic / vai.py
Created September 2, 2015 13:36
def get_uptime(self, obj):
return get_device_uptime(obj, 24 * 7)
@synic
synic / .spacemacs.el
Created September 21, 2015 22:54
python fill-column
; python hooks
(add-hook 'python-mode-hook (lambda ()
(fci-mode 1)
(auto-fill-mode)
(setq fill-column 79)
))
@synic
synic / gist:e58488851d59ca084c82
Created October 14, 2015 19:36 — forked from aussielunix/gist:1515957
search all graylog2-elasticsearch
curl -XGET 'http://localhost:9200/graylog2/_search?pretty=true' -d '
{
"query" : {
"matchAll" : {}
}
}'
@synic
synic / emacs.md
Created October 15, 2015 00:12
Fixing dired in spacemacs

First, add dired+ to dotspacemacs-additional-packages, then...

Before user-config in .spacemacs:

(defvar ao/v-dired-omit t
  "If dired-omit-mode enabled by default. Don't setq me.")

(defun ao/dired-omit-switch ()
 "This function is a small enhancement for `dired-omit-mode', which will
(defun save-framegeometry ()
"Gets the current frame's geometry and saves to ~/.emacs.d/framegeometry."
(let (
(framegeometry-left (frame-parameter (selected-frame) 'left))
(framegeometry-top (frame-parameter (selected-frame) 'top))
(framegeometry-width (frame-parameter (selected-frame) 'width))
(framegeometry-height (frame-parameter (selected-frame) 'height))
(framegeometry-file (expand-file-name "~/.emacs.d/framegeometry"))
)
def test_stuff():
reservation = factory.ReservationFactory.create()
db.session.commit()
#... run PUT request
# refresh the reservation so we can test that the PUT did it's thing
db.session.refresh(reservation)