View slack_history.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://gist.github.com/Chandler/fb7a070f52883849de35 SEE HERE | |
# MIT License | |
# Copyright (c) 2016 Chandler Abraham | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights |
View .tmux.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
# ~/.tmux.conf | |
# | |
# See the following files: | |
# | |
# /opt/local/share/doc/tmux/t-williams.conf | |
# /opt/local/share/doc/tmux/screen-keys.conf | |
# /opt/local/share/doc/tmux/vim-keys.conf | |
# |
View history.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function h() { | |
if [ -z "$1" ] | |
then | |
history | |
else | |
history | grep "$@" | |
fi | |
} | |
View auth0.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getUserFromRequest(r *http.Request) *model.User { | |
//Authorization: bearer {token} | |
//auth0 user is in user | |
jwtContext := context.Get(r, "user") | |
auth0Id := ((jwtContext.(*jwt.Token)).Claims).(jwt.MapClaims)["sub"] | |
user := model.GetUserFromAuthId(auth0Id.(string)) | |
return user | |
} |
View .js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<div className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<h2>Welcome to React</h2> | |
</div> | |
<p className="App-intro"> | |
To get started, edit <code>src/App.js</code> and save to reload. |
View gist:ebeb9a455089e88df7c0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.1.4' | |
# Use sqlite3 as the database for Active Record | |
gem 'sqlite3' | |
# Use SCSS for stylesheets | |
gem 'sass-rails', '~> 4.0.3' | |
# Use Uglifier as compressor for JavaScript assets |
View singleton.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _Cing_Singleton_H_ | |
#define _Cing_Singleton_H_ | |
/** | |
* @internal | |
* @file Singleton related utilities | |
*/ | |
#ifndef NULL | |
#define NULL 0 |
View gist:5e1dfc9d698aade1b81f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flash.utils.Timer; | |
import flash.events.Event; | |
import flash.events.TimerEvent; | |
import flash.events.MouseEvent; | |
import flash.external.ExternalInterface; | |
ExternalInterface.call("alert", "hello"); |
View gist:c0e0ca38346d6bfde019
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def associations_attributes | |
# Get a list of symbols of the association names in this class | |
association_names = self.class.reflect_on_all_associations.collect { |r| r.name } | |
# Fetch myself again, but include all associations | |
me = self.class.find self.id, :include => association_names | |
# Collect an array of pairs, which we can use to build the hash we want | |
pairs = association_names.collect do |association_name| | |
# Get the association object(s) |
View gist:8411998
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g mode-mouse on | |
set-window-option -g mode-mouse on | |
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
# ~/.tmux.conf | |
# | |
# See the following files: | |
# | |
# /opt/local/share/doc/tmux/t-williams.conf | |
# /opt/local/share/doc/tmux/screen-keys.conf |