Skip to content

Instantly share code, notes, and snippets.

Michael kagemusha

Block or report user

Report or block kagemusha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:b7f57be9becb4a054d780d8c95af22bc
echo "redoing aliases"
# alias to reload aliases in your current window
alias real=". ~/kagemusha/aliases/aliases"
# specific things i'm currently working on
alias rspet="rspec spec/controllers/api/canvas/email_templates_controller_spec.rb"
alias rspes="rspec spec/controllers/api/canvas/email_sections_controller_spec.rb"
alias dlvw="dlv debug github.com/kagemusha/vowpal_websrv -- --workers 1 --models ./sample_models"
alias 58="lsof -i tcp:5858"
@kagemusha
kagemusha / gist:b97db366ccec0fe11995c77755319295
Created Jun 19, 2018
Create postgres table with auto-incrementing primary key
View gist:b97db366ccec0fe11995c77755319295
// id SERIAL primary key
CREATE TABLE public.user_events
(
id serial primary key,
campaign_id bigint NOT NULL,
user_uuid bigint NOT NULL,
reward integer NOT NULL
)
@kagemusha
kagemusha / go get with private github repo
Created Jun 13, 2018
go get with private github repo
View go get with private github repo
1. If you are trying to `go get` a private repo, you need to be able to enter your `username` and `password` from the prompt.
To get the prompt you need to enable the git terminal prompt.
env GIT_TERMINAL_PROMPT=1 go get 'github.com/the-user/the-repo'
2. Because of 2FA you cannot use your password. You need to generate an access token and enter that in the password field
instead (you will want to copy at the clipboard on the token generation page, b/c it will be long). To generate the token, go
to [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new). Or from the Github UI,
` Setting - Developer Settings - Personal access tokens`
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@kagemusha
kagemusha / gist:8b95b93cfac710c7dd387f750432d1ed
Last active Apr 2, 2016
Updating an association with Elixir Ecto
View gist:8b95b93cfac710c7dd387f750432d1ed
defmodule PhoenixTimeline.Game do
...
schema "games" do
belongs_to :winner, PhoenixTimeline.Player
has_many :players, PhoenixTimeline.Player
...
end
...
end
View gist:8626265
1. install rack-cors gem (https://github.com/cyu/rack-cors)
gem 'rack-cors', :require => 'rack/cors'
2. add to application.rb
config.middleware.insert_before "Rack::Lock", "Rack::Cors", :debug => true, :logger => Rails.logger do
allow do
origins '*'
@kagemusha
kagemusha / gist:6783059
Created Oct 1, 2013
Ember Data Store Synchronous Methods - not a complete list
View gist:6783059
store.getById
sync return rec from store if avail or return null
e.g.
var post = store.getById('post', 1);
filter: function(type, query, filter)
@param {Class} type
@param {Function} filter
@kagemusha
kagemusha / gist:6769178
Created Sep 30, 2013
Ember linkTo => link-to (c. Em.v1.0 9/26/2013)
View gist:6769178
In general:
1. somepropBinding=val => someprop=val
2. except for classNameBindings
e.g. classNameBindings=":option isSelected:selected"
for example:
{{#linkTo
option.path
typeBinding=option.value
@kagemusha
kagemusha / gist:6716491
Created Sep 26, 2013
Query Params in Ember
View gist:6716491
https://github.com/emberjs/ember.js/pull/3182
@kagemusha
kagemusha / gist:5866759
Created Jun 26, 2013
Using Debugger with Grunt
View gist:5866759
version: grunt-cli v0.1.8
1. Install node-inspector globally (-g)
npm install -g node-inspector
2. Add debugger statements to your code
3. Run your grunt task in debug mode
You can’t perform that action at this time.