Skip to content

Instantly share code, notes, and snippets.

View aparrish's full-sized avatar

Allison Parrish aparrish

View GitHub Profile
@acdha
acdha / simple_cors_server.py
Last active April 25, 2024 07:13
Python 3: serve the current directory as HTTP while setting CORS headers for XHR debugging
#!/usr/bin/env python3
# encoding: utf-8
"""Use instead of `python3 -m http.server` when you need CORS"""
from http.server import HTTPServer, SimpleHTTPRequestHandler
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Access-Control-Allow-Origin', '*')
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@kylemcdonald
kylemcdonald / _tsne.pdf
Last active February 22, 2024 22:13
Exploring antonyms with word2vec.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mcleonard
mcleonard / vector.py
Last active February 22, 2024 12:30
A vector class in pure python.
import math
class Vector(object):
def __init__(self, *args):
""" Create a vector, example: v = Vector(1,2) """
if len(args)==0: self.values = (0,0)
else: self.values = args
def norm(self):
""" Returns the norm (length, magnitude) of the vector """
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Interactive Machine Learning

Taught by Brad Knox at the MIT Media Lab in 2014. Course website. Lecture and visiting speaker notes.

@entron
entron / imdb_cnn_kim_small_embedding.py
Last active September 16, 2023 16:23
Keras implementation of Kim's paper "Convolutional Neural Networks for Sentence Classification" with a very small embedding size. The test accuracy is 0.853.
'''This scripts implements Kim's paper "Convolutional Neural Networks for Sentence Classification"
with a very small embedding size (20) than the commonly used values (100 - 300) as it gives better
result with much less parameters.
Run on GPU: THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python imdb_cnn.py
Get to 0.853 test accuracy after 5 epochs. 13s/epoch on Nvidia GTX980 GPU.
'''
from __future__ import print_function
@selfsame
selfsame / computers.ni
Created October 2, 2018 23:55
computers.ni
"dungeon planet" by Joseph Parker
Book 1 - Rules
Chapter 1 - Computers
An operating system is a kind of value. The operating systems are linux.
A computer is a kind of device. Understand "computer" as computer.
A computer has a text called power_up_text.
@AdamGagorik
AdamGagorik / remote-jupyter-notebook.md
Last active June 5, 2023 06:48
Remote Jupyter Notebook

Description

Use these commands to run a jupyter server on a remote server and access it locally in a browser. You must have SSH access to the browser. Use any port you want.

Do not forget to change username@server to the correct value!

TLDR

where using command
@cyberdelia
cyberdelia / fabfile.py
Created April 3, 2010 14:05
Fabric deploy script with : south migrations, rollback and maintenance page.
from fabric.api import env, run, sudo, local, put
def production():
"""Defines production environment"""
env.user = "deploy"
env.hosts = ['example.com',]
env.base_dir = "/var/www"
env.app_name = "app"
env.domain_name = "app.example.com"
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name }