Skip to content

Instantly share code, notes, and snippets.

View alexanderattar's full-sized avatar
💭
⚡️

Alexander alexanderattar

💭
⚡️
View GitHub Profile
@alexanderattar
alexanderattar / django_1.5_upgrade_url_tag
Created October 16, 2014 19:12
converts url tags to the new style format in django 1.5 and up. i.e. {% url whatever args %} -> {% url 'whatever' args %}. run it from your templates directory
find . -type f -print0 | xargs -0 sed -i '' -e "s/ url \([^\" >][^ >]*\)/ {% url '\1'/g"
@alexanderattar
alexanderattar / gist:11aaa2469f76d192b5df3ed41374e959
Created April 12, 2016 16:42 — forked from patricklynch/gist:689525d466c4ada42b8e
The 6 ways to unwrap optionals in Swift 2.0
// The 6 ways to uwnrap optionals in Swift 2.0
//
// Created by Patrick Lynch on 6/28/15.
// Copyright © 2015 Patrick Lynch. All rights reserved.
import Foundation
// 1. Force Unwrapping
// 2. Optional Binding
// 3. Optional Chaining
@alexanderattar
alexanderattar / celery.sh
Created July 28, 2016 20:43 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),

Keybase proof

I hereby claim:

  • I am Alexander-Attar on github.
  • I am alexattar (https://keybase.io/alexattar) on keybase.
  • I have a public key whose fingerprint is 3B95 F724 F194 DD4C 9E16 17EE 2A97 2ADD 2683 7B53

To claim this, I am signing this object:

@alexanderattar
alexanderattar / httplib2_post_json.py
Created August 23, 2016 20:54 — forked from wrunk/httplib2_post_json.py
Python httplib2 POST json body with auth example
#! /usr/bin/env python
'''
This is more of a personal reference as I use json very often.
The httplib2 examples are VERY good, and you should refer to them:
http://code.google.com/p/httplib2/wiki/Examples
'''
from httplib2 import Http
try:
@alexanderattar
alexanderattar / GitHub.tmTheme
Created December 14, 2016 20:52
Original Version of Alexander Ekdahl's theme before they changed the colors https://github.com/AlexanderEkdahl/github-sublime-theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>GitHub</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>

Keybase proof

I hereby claim:

  • I am alexanderattar on github.
  • I am alexattar (https://keybase.io/alexattar) on keybase.
  • I have a public key whose fingerprint is 3B95 F724 F194 DD4C 9E16 17EE 2A97 2ADD 2683 7B53

To claim this, I am signing this object:

0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
0xd1901a035D234Ee458a3a85d9373C33D9728823a