Skip to content

Instantly share code, notes, and snippets.

View ignu's full-sized avatar
🏳️‍🌈
interested in: react/typescript rails/ruby elixir & graphql

Leonard Smith ignu

🏳️‍🌈
interested in: react/typescript rails/ruby elixir & graphql
View GitHub Profile
@ignu
ignu / items.json
Last active August 29, 2015 13:56
{"items":[
{"name":"left-arrow","quantity":1,"repaint":false},
{"name":"right-arrow","quantity":1,"repaint":false},
{"name":"combo-left-thru","quantity":1,"repaint":false}] }
@ignu
ignu / composite_table_view.coffee
Last active August 29, 2015 14:01
CompositeTableView
@MyApp.module "Concerns", (Concerns, App, Backbone, Marionette, $, _) ->
Concerns.CompositeTableView =
template: "backbone/_concerns/templates/composite_table_view"
itemViewContainer: "tbody"
ui:
"headerRow" : "thead tr"
"actions" : ".actions"
"description" : ".description"
do (Backbone) ->
_sync = Backbone.sync
Backbone.sync = (method, entity, options = {}) ->
_.defaults options,
beforeSend: _.bind(methods.beforeSend, entity)
complete: _.bind(methods.complete, entity)
sync = _sync(method, entity, options)
if !entity._fetch and method is "read"
# doesn't work
# Error: /Users/ignu/code/true-app/spec/react-tests/log-activity-test.coffee:
# Cannot find module './log_activity' from '/Users/ignu/code/true-app/spec/react-tests/log-activity-test.coffee'
r = (path)->
jest.dontMock path
require path
r('./log_activity')
# totally works fine
jest.dontMock('./log_activity')
@ignu
ignu / cloudstack.java
Last active August 29, 2015 14:15
"snapshotshot 4"
private void handleException(Exception e) {
String[] error = e.getMessage().split("Error Code - ");
String errorMessage = error[0];
if (error.length == 2) { // error code has been supplied
int errorCode = Integer.parseInt(error[1]);
if (errorCode == 431) {
// ...
} else if (errorMessage.contains("Can't delete snapshotshot 4 due to it is not in BackedUp Status")) {
throw new EC2ServiceException(ClientError.IncorrectState, "Specified snapshot is not in the correct state 'completed' for deletion");
} else if (errorMessage.contains("Public key is invalid")) {
#!/bin/bash
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@ignu
ignu / data.csv
Last active August 29, 2015 14:27
data! from editdata.org!
cool o
oneaf adsf
af asdf
@ignu
ignu / data.csv
Created August 19, 2015 03:32
data! from editdata.org!
one two three yeah
hi bye oh oh
$("#ui-datepicker-div").addClass("promoteZ");
CSS:
.promoteZ {
z-index: 2006; /* Dialog z-index is 1006*/
}
def save
@campsite = Campsite.new(self.params[:campsite])
@campsite.save!
redirect_to "/campgrounds/#{@campsite.name}/campsites"
end