Skip to content

Instantly share code, notes, and snippets.

View Teino1978-Corp's full-sized avatar

Teino Boswell Teino1978-Corp

  • Ocho Rios, Jamaica
View GitHub Profile
@Teino1978-Corp
Teino1978-Corp / The Technical Interview Cheat Sheet.md
Last active August 27, 2015 05:41 — forked from imvikash00/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
public class MockTweeterApi extends TweeterApi{
public MockTweeterApi(Retrofit retrofit, LocalDataCache dataCache, Scheduler mainScheduler) {
super(retrofit, dataCache, mainScheduler);
}
@Override
public Observable<UserProfile> login(String username, String password) {
return Observable.just(new UserProfile(username, password))
.observeOn(mainScheduler);
}
@Teino1978-Corp
Teino1978-Corp / new-session.sh
Last active August 27, 2015 07:49 — forked from arpanpal010/new-session.sh
TMUX session creator / manager
#!/bin/bash
sessionPWD="/home/$USER/";
sessionName="new-session"; #must be same as filename
#check if already created
cd ${sessionPWD};
#create SESSION
tmux new-session -s ${sessionName} -n vim -d
#first window 1: vim
tmux send-keys -t ${sessionName} 'vim' C-m
@Teino1978-Corp
Teino1978-Corp / cleaning.r
Last active September 1, 2015 08:40 — forked from RMinto/cleaning.r
cleaning
make.numeric <- function(data, x) {
for (i in x) {
data[ , i] <- as.numeric(data[ , i])
}
data
}
make.char <- function(data, x) {
@Teino1978-Corp
Teino1978-Corp / cleaner.lua
Last active September 1, 2015 08:52
Cleans.
-- Created by Krock
-- License: WTFPL
minetest.register_craft({
output = "special:cleaner",
recipe = {
{ "", "wool:blue", "" },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
{ "wool:white", "wool:white", "wool:white" },
}
})
@Teino1978-Corp
Teino1978-Corp / gpg-git-smudge-clean.md
Last active September 20, 2015 23:08 — forked from g-k/gpg-git-smudge-clean.md
test transparent git encryption with smudge clean filters using gpg

Generate a GPG Key and revocation cert per http://www.gnupg.org/gpg/en/manual.html:

gpg --key-gen
gpg --output revoke.asc --gen-revoke <my user ID or email>

Once gpg key in keyring we can encrypt and decrypt files.

@Teino1978-Corp
Teino1978-Corp / ip_guys
Created September 30, 2015 17:15 — forked from jesseract/ip_guys
IP lawyers
Intellectual property
4 types of protection
1. patent -compositions of matter, devices
2. copyright - original expression (including software)
3. trademark - source id/consumer goodwill
4. trade secret - valuable, secret business
What is copyrightable?
-original works, including software
-default rule is authorship = ownership (unless it's a work made for hire for your employer)
@Teino1978-Corp
Teino1978-Corp / HelloWorld.java
Created September 30, 2015 17:32 — forked from wmill/HelloWorld.java
Sun's example code, proof that coders love lawyers.
/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
resources :lawfirms, :only => [ :show, :new, :create, :lawyer ] do
collection do
get :lawyers
end
end
@Teino1978-Corp
Teino1978-Corp / 0-STATE-RUN-SALT-API-GITHUB-HOOK-USE-CASE.md
Created October 3, 2015 00:09 — forked from renoirb/0-STATE-RUN-SALT-API-GITHUB-HOOK-USE-CASE.md
State runner on salt-api POST from GitHub push hook

Validate and run a state when a valid GitHub hook call has been received from salt-api

Idea is that we can setup salt-api to receive hook call from GitHub, and configured run stat.sls only if the request HMAC signature matche is successful.

Unfortunately most documentation says to deactivate salt-api hooks authentication (i.e. webhook_disable_auth: True) which is not a good idea.

This Gist is about finding a way to declare which state to run based on data GitHub sends on push hook. But ONLY if the request is valid.

Skeleton defines desired logic, see reactor_github_push.py below.