Skip to content

Instantly share code, notes, and snippets.

View aaronlelevier's full-sized avatar

Aaron Lelevier aaronlelevier

View GitHub Profile
# urls.py
url(r'^api/logout/$', apiauth_views.LogoutView.as_view()),
# views.py
from django.contrib import auth
from rest_framework.views import APIView
class LogoutView(APIView):
-export([ride_bike/0]).
ride_bike() -> io:fwrite("Ride bike", []).
@aaronlelevier
aaronlelevier / sunday.erl
Last active February 10, 2019 20:35
Sunday Feb 10, 2019 - Learning Erlang for an hour
23> Person = {person, {age, 34}, {hobby, "biking"}}.
{person,{age,34},{hobby,"biking"}}
24> A.
* 1: variable 'A' is unbound
25> B.
* 1: variable 'B' is unbound
26> A, B = Person.
* 1: variable 'A' is unbound
27> {A, B} = Person
27> .
{
"python.pythonPath": "venv/bin/python",
"python.linting.pylintArgs": [
"--extension-pkg-whitelist=torch"
]
}
# A very simple perceptron for classifying american sign language letters
import signdata
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense, Flatten, Dropout, BatchNormalization, Conv2D, MaxPooling2D
from keras.utils import np_utils
import wandb
from wandb.keras import WandbCallback
from keras.optimizers import RMSprop
# A very simple perceptron for classifying american sign language letters
import signdata
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense, Flatten, Dropout, BatchNormalization, Conv2D, MaxPooling2D
from keras.utils import np_utils
import wandb
from wandb.keras import WandbCallback
@aaronlelevier
aaronlelevier / .gitshortcuts
Created June 22, 2018 12:42
Git command aliases
alias gitlog='git log --pretty=format:"%h%x09%an%x09%ad%x09%s"'
alias gs='git status'
alias gd='git diff'
alias gds='git diff --staged'
alias gl='git log'
alias ga='git add'
alias gb='git branch'
alias gc='git commit'
alias gco='git checkout'
alias gpr='git pull --rebase'
@aaronlelevier
aaronlelevier / Default (OSX).sublime-keymap
Created June 5, 2018 11:18
Sublime Text 3 Key Bindings
[{
"keys": ["alt+up"],
"command": "scroll_lines",
"args": {
"amount": 30.0
}
}, {
"keys": ["alt+down"],
"command": "scroll_lines",
"args": {
@aaronlelevier
aaronlelevier / Preferences.sublime-settings
Last active August 1, 2019 03:26
Sublime Text 3 Settings
{
"binary_file_patterns":
[
"*min.js",
"*.debug.js",
"*prod.js",
"*.dex",
"*.zip",
"*.bin",
".coverage",
@aaronlelevier
aaronlelevier / github_followers.py
Created April 5, 2018 13:17
Demonstrates use of Threads in Python and how the GIL is release during I/O
#!/usr/bin/env python
import argparse
import functools
import json
import os
import timeit
from queue import Queue
from threading import Thread
import requests