Skip to content

Instantly share code, notes, and snippets.

View joshuatobin's full-sized avatar

Joshua Tobin joshuatobin

  • Salesforce
  • Saratoga Springs, NY
View GitHub Profile
@joshuatobin
joshuatobin / gist:6a8d33ac605bafda27e21a5f7dcb2779
Created August 17, 2016 14:20
Get reload! to work in binding.pry
# .pryrc checked into my project root
require 'rails/console/app'
include Rails::ConsoleMethods
@joshuatobin
joshuatobin / frontend dev.md
Last active July 21, 2016 14:25
HTML, HAML, CSS cheatsheet

HTML

  • DOCTYPE
<!DOCTYPE html>
<html>  </html>
  • Making Comments:
@joshuatobin
joshuatobin / OpenID-Connect.md
Last active December 10, 2015 14:55
OpenID Connect Notes

OpenID-Connect (OPIC)

Authentication Protocol built on top of OAuth 2.0. AKA "Identity framework build on TOP of Oauth 2.0" It extends the authorization process of Oauth2.0 to implement its authentication. This facilitates the client to verify the end user identity against authentication performed by an authorization server. It also provides methods to transfer the end user information.

OAuth

Some points about Oauth quick:

  • It provides Delegated access
@joshuatobin
joshuatobin / Erase hipchat
Last active August 1, 2017 08:05
Remove hipchat private chat
#!/usr/lib/ruby env
# Modified from https://gist.github.com/jpr5/4260656
require 'rubygems'
require 'mechanize'
account = {
:email => "example@example.com",
:password => "123456",
}
agent = Mechanize.new
Personalities :
md127 : inactive xvdi1[1](S) xvdi2[62](S)
class jenkins::package {
package {
'jenkins' :
ensure => installed,
require => File['/var/lib/jenkins'],
}
file { '/var/lib/jenkins':
ensure => 'link',
target => '/mnt/jenkins',
before => Package['jenkins'],
(Anchor[apt::key D50582E6 present] => Apt::Key[Add key: D50582E6 from Apt::Source jenkins] => File[jenkins.list] => Exec[apt_update] => Class[Apt::Update] => Stage[pre] => Stage[main] => Class[Jenkins::Repo::Debian] => Apt::Source[jenkins] => File[jenkins.list])
node default {
stage {"pre": before => Stage["main"]}
case $operatingsystem {
/(Ubuntu|Debian)/: {
class { 'apt': stage => 'pre', }
}
}
41 /etc/init.d/tomcat7 stop
42 cd /var/lib/tomcat7/
43 ls
44 cd webapps/
45 ls
46 rm -rf ROOT
47 /etc/init.d/tomcat7 start
# models.py
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
class UserProfile(models.Model):
user = models.OneToOneField(User)
flip_databases = models.BooleanField()