Skip to content

Instantly share code, notes, and snippets.

Josh Deeden gangster

  • Los Angeles, CA
Block or report user

Report or block gangster

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:fa7c4c35a1b50e67d4216dde9b6974e4
### Keybase proof
I hereby claim:
* I am gangster on github.
* I am jdeeden (https://keybase.io/jdeeden) on keybase.
* I have a public key ASA2ndWI_n5QpVakwV_vkwCQ2VQ1ywaiNx7BvhWHvlCZago
To claim this, I am signing this object:
View gist:19a61d2b72704256543d
class Article < ActiveRecord::Base
belongs_to :category
end
class Category < ActiveRecord::Base
has_many :articles
end
View gist:dac07850210251b9bd56

Primer

Objective

Write a program that prints out a multiplication table of the first N prime numbers.

The program must run from the command line and print a single table to the screen.

Across the top and down the left side should be the N primes, and the body of the table should contain the product of multiplying these numbers.

View gist:1a2ad3cb1c45994aa11b
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
View gist:73a3128495cdf167ff70
FROM dockerfile/ubuntu
# Install node.js and forever
RUN add-apt-repository ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get -y install nodejs
RUN npm -g update npm
RUN npm install -g forever
View grape_api_sample.rb
require 'grape'
module My
class API < Grape::API
prefix 'api'
## params key list
#################################################################################################################
# 1. login
# 2. sign
View hit iterator spec
require 'spec_helper'
describe Iterator do
let(:bar) { Factory(:bar) }
let(:worker) { Factory(:worker) }
before(:all) do
hit_type = Factory(:hit_type)
hit_type.register!
end
View mongoid.rb
file 'Gemfile', <<-GEMS
source 'http://gemcutter.org'
gem "rails", "3.0.3"
gem "bson_ext"
gem "mongoid", "2.0.0.beta.20"
gem "haml", "3.0.24"
gem "compass", "0.10.6"
gem "inherited_resources"
group :test do
View tpl-devise-rspec-cuke.rb
# Application Generator Template
# Devise, Cucumber, RSpec... for use with Rails 3
# http://gist.github.com/513564
# Based on the Mongoid/Devise template: http://github.com/fortuity/rails3-mongoid-devise/raw/master/template.rb
#
#
# Installs my js_lib rakefile, found: http://gist.github.com/raw/628715/js_lib.rake
# (to keep js libraries out of source control.)
#
# Usage:
You can’t perform that action at this time.