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 / 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")) {
# 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')
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"
@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"
@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}] }
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
@ignu
ignu / gist:5685418
Last active December 17, 2015 22:58
1) you don't need the var keyword. all variables will be protected from the global scope.
2) functions automatically return the last line, called an "explicit return"
3) functions are the funkiest looking but really simple. they look like this:
(obj) -> "this is my #{obj}"
instead of:
function(obj) {
return "this is my " + obj);
@ignu
ignu / gist:3286557
Created August 7, 2012 15:51
falling in love with keymando
map "<Cmd-Ctrl-p>" { Spotify.play_pause }
map "<Cmd-Ctrl-j>" { Spotify.next }
map "<Cmd-Ctrl-k>" { Spotify.previous }
map "<Cmd-Shift-m>" { activate("MacVim") }
map "<Cmd-Shift-b>" { activate("Google Chrome") }
only /iTerm/ do
map '<Cmd-w>', nil
map '<Cmd-q>', nil
☁ code cd stylitics
Can't locate auto/DynaLoader/dl_findfile.al in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at /System/Library/Perl/5.12/darwin-thread-multi-2level/DynaLoader.pm line 168
Compilation failed in require at /System/Library/Perl/5.12/darwin-thread-multi-2level/IO/Handle.pm line 266.
BEGIN failed--compilation aborted at /System/Library/Perl/5.12/darwin-thread-multi-2level/IO/Handle.pm line 266.
Compilation failed in require at /System/Library/Perl/5.12/darwin-thread-multi-2level/IO/Seekable.pm line 101.
BEGIN failed--compilation aborted at /System/Library/Perl/5.12/darwin-thread-multi-2level/IO/Seekable.pm line 101.
Compilation failed in require at /System/Library/Perl/5.
☁ academicladder [ls-locking-groups] ⚡ rvm install ree
Installing Ruby Enterprise Edition from source to: /Users/ignu/.rvm/rubies/ree-1.8.7-2011.03
It appears that the archive has already been extracted. Skipping extract (use --force to force re-download and extract).
ree-1.8.7-2011.03 - #installing
ERROR: Error running './installer -a /Users/ignu/.rvm/rubies/ree-1.8.7-2011.03 --no-tcmalloc --dont-install-useful-gems ', please read /Users/ignu/.rvm/log/ree-1.8.7-2011.03/install.log
ERROR: There has been an error while trying to run the ree installer. Halting the installation.
☁ academicladder [ls-locking-groups] ⚡ tail /Users/ignu/.rvm/log/ree-1.8.7-2011.03/install.log
It looks like the source is already configured.
Skipping configure script...
/usr/bin/gcc-4.2 -dynamiclib system_allocator.c -install_name @rpath/libsystem_allocator.dylib -o libsystem_allocator.dylib