Skip to content

Instantly share code, notes, and snippets.

@gangster
gangster / gist:59701645ef0f7d2923421934c73e0962
Created February 5, 2024 22:33
CKA/CKAD Optimal Vim Config
set ts=2 sts=2 sw=2 " configure indentation to be 2 spaces
set expandtab " very important. prevents the insertion of TAB characters in the input. Expands tabs to 2 spaces.
set number ruler " turn on line numbers
set autoindent smartindent " convenience when editing yaml. auto-indents when pressing enter
syntax enable " enable syntax highlighting
filetype plugin indent on " turn on highlighting for any vim plugins
:set paste " Ensure copying/pasting works as expected within vim
### 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:
require 'grape'
module My
class API < Grape::API
prefix 'api'
## params key list
#################################################################################################################
# 1. login
# 2. sign
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
@gangster
gangster / mongoid.rb
Created November 19, 2010 02:53 — forked from fcoury/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
# 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:
class Article < ActiveRecord::Base
belongs_to :category
end
class Category < ActiveRecord::Base
has_many :articles
end
@gangster
gangster / gist:dac07850210251b9bd56
Created February 19, 2015 15:47
Primex Coding Challenge

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.

#!/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
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