Skip to content

Instantly share code, notes, and snippets.

@octoberstorm
octoberstorm / aws-ec2-redis-cli.md
Created February 27, 2018 08:56 — forked from todgru/aws-ec2-redis-cli.md
AWS redis-cli on EC2
@octoberstorm
octoberstorm / aescmd.go
Created December 28, 2017 03:57 — forked from josephspurrier/aescmd.go
Golang - Encrypt, Decrypt, File Read, File Write, Readline
package main
import (
"bufio"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
@octoberstorm
octoberstorm / query_finder.sql
Created December 21, 2017 09:49 — forked from mezis/query_finder.sql
Finding long-running queries in MySQL
SELECT id,state,command,time,left(replace(info,'\n','<lf>'),120)
FROM information_schema.processlist
WHERE command <> 'Sleep'
AND info NOT LIKE '%PROCESSLIST%'
ORDER BY time DESC LIMIT 50;
@octoberstorm
octoberstorm / app.component.spec.ts
Created November 1, 2017 01:44 — forked from deebloo/app.component.spec.ts
Angular2 Webpack basic setup with UNIT TESTS!
// src/app.components.ts
import {AppComponent} from './app.component';
import {Injector} from '@angular/core';
import {expect, it, describe, beforeEach, beforeEachProviders, inject} from '@angular/core/testing';
describe('Component: AppComponent should be created', function () {
let fooComponent: FooComponent;
beforeEachProviders(() => [
@octoberstorm
octoberstorm / gist:de451d9c3a4d67af02bd248f191bddee
Created February 22, 2017 02:59 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/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
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@octoberstorm
octoberstorm / faye.rb
Created March 18, 2016 07:52 — forked from tmcallister/faye.rb
Faye with nginx config
FAYE_TOKEN = 'secretToken'
if defined? Rails
if Rails.env == 'development'
FAYE_URI = "http://#{APP_CONFIG[:nameremoved_service][:host]}:9292/faye"
else
FAYE_URI = "https://#{APP_CONFIG[:nameremoved_service][:host]}/faye"
end
@octoberstorm
octoberstorm / Gemfile
Created March 5, 2016 14:27 — forked from gvarela/Gemfile
web sockets with eventmachine and redis pub/sub
# A sample Gemfile
source "http://rubygems.org"
gem "redis"
gem 'eventmachine', :git => 'git://github.com/eventmachine/eventmachine.git'
gem "em-hiredis"
# gem "em-synchrony"
gem "em-websocket"

Capybara

save_and_open_page

Matchers

have_button(locator)
-- model
some sort of constant hash:
HASH_NAME = {
0 => "Choose:",
1 => "On-Campus Recruiting - CSO",·
2 => "CSO Staff Referral",
3 => "Faculty Contact",·
4 => "Career Day",·
5 => "CSO Summer Job Listing",·
6 => "Alumni Contact",·