Skip to content

Instantly share code, notes, and snippets.

View claytantor's full-sized avatar
💭
Doing and Being

Clay Graham claytantor

💭
Doing and Being
View GitHub Profile
@claytantor
claytantor / gist:a4f7ac88e96873fa9461
Created November 1, 2014 16:47
google auth2 views.py
import os
import logging
import httplib2
from apiclient.discovery import build
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.http import HttpResponseBadRequest
from django.http import HttpResponseRedirect
@claytantor
claytantor / gist:b75540e765540c775994
Created November 22, 2014 01:52
diatomic hello world
[ec2-user@ip-10-65-176-236 datomic-free-0.9.5067]$ bin/groovysh
Nov 22, 2014 1:45:44 AM java.util.prefs.FileSystemPreferences$2 run
INFO: Created user preferences directory.
Groovy Shell (1.8.9, JVM: 1.6.0_33)
Type 'help' or '\h' for help.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
groovy:000> import datomic.Peer
import datomic.Peer
===> [import datomic.Peer]
groovy:000> uri = "datomic:mem://hello"
@claytantor
claytantor / gist:b64b4c9fb3177761dd1b
Created November 23, 2014 04:41
DatomicClient for scala
package db
import scala.language.reflectiveCalls
import datomisca._
import scala.concurrent._
import scala.concurrent.duration.Duration
import java.util.{Date => JDate}
import datomisca.executioncontext.ExecutionContextHelper._
class DatomicClient {
@claytantor
claytantor / gist:7cd28eaef43d42df9413
Created November 25, 2014 01:26
remove .idea files from git
git rm --cached *.xml
git rm --cached vcs.xml
git rm --cached modules.xml
git rm --cached misc.xml
git rm --cached encodings.xml.xml
git rm --cached encodings.xml
git rm --cached deployment.xml
git rm --cached dataSources.xml
git rm --cached dataSources.ids
git rm --cached callpug.iml
@claytantor
claytantor / settings.ini
Last active August 29, 2015 14:12
How to create environment based settings configs
[secrets]
DJANGO_SECRET_KEY: ill%92_5+gaw!7p5la0h+-=-pb2)l&%11(d@a8+#mff5z$r3^
@claytantor
claytantor / views.py
Last active August 29, 2015 14:12
Backflips related to using Mailchimp OAuth2 Implementation
# AUTH
# ******************************************************************************************
# Step 1: Your application begins the authorization process by redirecting the user to the authorize_uri
#
# - this is a GET request
# - response_type=code, your client_id, and the *urlencoded* redirect_uri are included
# ******************************************************************************************
#
# authorize_uri = https://login.mailchimp.com/oauth2/authorize?response_type=code&client_id=635959587059&redirect_uri=http%3A%2F%2F192.168.1.8%2Foauth%2Fcomplete.php
@claytantor
claytantor / csr_text.txt
Last active August 29, 2015 14:12
Generate CSR and Key Files
$ openssl req -nodes -newkey rsa:2048 -keyout mysite_com.key -out mysite_com.csr
Generating a 2048 bit RSA private key
.........................+++
.................................................................+++
writing new private key to 'mysite_com.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
@claytantor
claytantor / gist:47e87d30e8f60d274bbb
Created January 10, 2015 23:04
twilio date conversion
datetime.strptime("Sun, 04 Jan 2015 00:06:51 +0000"[:-6],"%a, %d %b %Y %H:%M:%S")
@claytantor
claytantor / sudoer.sh
Created January 16, 2015 05:11
sudoer for ssh user
mysuer ALL=(ALL) NOPASSWD:ALL
@claytantor
claytantor / install_276.sh
Last active August 29, 2015 14:14
installing python 2.7.6.for django
cd ~/src
sudo yum groupinstall "Development tools"
sudo yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
sudo yum install httpd-devel
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xf Python-2.7.6.tar.xz
cd Python-2.7.6
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
sudo make && sudo make altinstall
python