Skip to content

Instantly share code, notes, and snippets.

View maxgillett's full-sized avatar

Max Gillett maxgillett

View GitHub Profile
<div id="fb-root"></div> <!-- Needed for facebook to function properly. See facebook sdk for more info. -->
<div id="results"></div>
<p id="connect">
<a class="signin" href="#">Signin</a>
<a class="signout" href="#">Signout</a>
</p>
<script type="text/javascript">
class Authentication < ActiveRecord::Base
attr_accessible :provider, :token, :uid, :user_id
belongs_to :user
end
class AuthenticationsController < ApplicationController
def create
auth = request.env['omniauth.auth']
logger.debug "Auth variable: #{auth.inspect}"
# Try to find authentication first
authentication = Authentication.find_by_provider_and_uid(auth['provider'], auth['uid'])
unless current_user
# Request a new 60 day token using the current 2 hour token obtained from fb
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:omniauthable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
<link rel="stylesheet"
href="http://yandex.st/highlightjs/6.1/styles/zenburn.min.css">
<style>
code {
font-family: monospace;
overflow: auto;
}
</style>
<script src='http://yandex.st/highlightjs/6.1/highlight.min.js'></script>
@maxgillett
maxgillett / vim.rb
Last active December 14, 2015 00:48 — forked from mgrouchy/vim.rb
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
head 'https://vim.googlecode.com/hg/'
url 'http://ftp.debian.org/debian/pool/main/v/vim/vim_7.4.225.orig.tar.gz'
sha1 '674fafec19e24f75113c9f5a8440a85e8e636c3e'
def features; %w(tiny small normal big huge) end
@maxgillett
maxgillett / vim.rb
Last active December 29, 2015 14:49
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
# This package tracks debian-unstable: http://packages.debian.org/unstable/vim
url 'http://ftp.debian.org/debian/pool/main/v/vim/vim_7.4.052.orig.tar.gz'
sha1 '216ab69faf7e73e4b86da7f00e4ad3b3cca1fdb8'
head 'https://vim.googlecode.com/hg/'
@maxgillett
maxgillett / sim.py
Last active June 28, 2022 08:46
VogelsAbbott2005 Network
from __future__ import division
import sys
import time
from brian2 import *
#import matplotlib.pyplot as plt
delays = False
method = 'euler'
# RNG seed
@maxgillett
maxgillett / bot.py
Created August 26, 2015 04:23
JSwipe Bot
import sys
import json
import argparse
from time import sleep
from random import randint
from datetime import datetime
import requests

Keybase proof

I hereby claim:

  • I am maxgillett on github.
  • I am maxgillett (https://keybase.io/maxgillett) on keybase.
  • I have a public key ASA0TjejyzYSULoVZQIGTyJne2nbeIC9X8hXnBjN1GOi2Ao

To claim this, I am signing this object: