Skip to content

Instantly share code, notes, and snippets.

View gjackson12's full-sized avatar

Graham Jackson gjackson12

View GitHub Profile
@gjackson12
gjackson12 / bash_profile
Created October 8, 2018 19:58
Sample bash_profile
# export PATH=$PATH:/usr/bin
if [ -f ~/.bash_colors ]; then
source ~/.bash_colors
fi
## RBENV ##
eval "$(rbenv init -)"
## NVM ##
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { MaterialModule } from './material.module';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
MaterialModule
],
@gjackson12
gjackson12 / output.txt
Created December 14, 2017 21:20
Output PS
3b94gf7a49zd ppml_ckan replicated 2/2 gjackson12/gjackson-ckan:version100 *:5000->5000/tcp
cxxzb7k98q8y ppml_postgres replicated 1/1 gjackson12/gjackson-ckan-postgres:version39 *:5432->5432/tcp
nhmrdytpcgqx ppml_redis replicated 2/2 redis:latest
tfpx2n3ig4cf ppml_solr replicated 1/1 gjackson12/gjackson-ckan-solr:version65 *:8983->8983/tcp
@gjackson12
gjackson12 / sample.sh
Created December 13, 2017 06:47
Sample Shell Script
#check_psql() {
# curl gjackson-ckan-postgres:5432 2>/dev/null
# if [ $? -ne 52 ]
# then
# return 1
# fi
# return 0
#}
#while ! check_psql
afka_1 | 2015-11-23 15:16:52,084 INFO spawned: 'zookeeper' with pid 10
kafka_1 | 2015-11-23 15:16:52,086 INFO spawned: 'kafka' with pid 11
kafka_1 | 2015-11-23 15:16:53,093 INFO success: zookeeper entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
kafka_1 | 2015-11-23 15:16:53,093 INFO success: kafka entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
app:
build: .
command: bundle exec rails s -p 3000 --binding 0.0.0.0
environment:
DB_HOSTNAME: db
DB_PASSWORD: access
DB_USERNAME: admin
REDIS_URL: redis://redis:6379/0
links:
- db
==> Downloading ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.15.tar.bz2
Already downloaded: /Library/Caches/Homebrew/gnupg-1.4.15.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/gnupg/1.4.15 --disable-asm
==> make CFLAGS= -std=gnu89 -fheinous-gnu-extensions
==> make check
==> make install
@gjackson12
gjackson12 / a.rb
Created May 19, 2014 19:21 — forked from ahoward/a.rb
# fork it
#
# make it print all true with only ONE LINE OF CODE
class A
def A.foo
@foo ||= (
if self == A
'42.0'
else
@gjackson12
gjackson12 / blackjack.rb
Last active December 25, 2015 18:08
I probably should create a game class for the flow but not sure how to go about it.
class Deck
SUITS = ['♠', '♣', '♥', '♦']
VALUES = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']
def initialize
@cards = []
SUITS.each do |suit|
VALUES.each do |value|
@cards.push(Card.new(value,suit))
function guessColor(actualResult, userGuess){
if(actualResult === userGuess){
return 'green'
}
else {
return 'red'
}
};
function decorateClick(theFunc){