Skip to content

Instantly share code, notes, and snippets.

@Nopik
Nopik / application.js.hamlbars
Created September 1, 2012 09:30
Named outlets in Ember views
.navbar.navbar-fixed-top
%ul.dropdown-menu
%li.nav-header
Projects
%li.divider
{{outlet projectNames}}
%li.divider
5477 22:34:04 NopiMac ~/Warsztat/logstash$ java -jar logstash-1.1.1-monolithic.jar agent -f hello-search.conf -- web --backend 'elasticsearch:///?local'
Exception in thread "LogStash::Runner" org.jruby.exceptions.RaiseException: (LoadError) Unable to activate ftw-0.0.19, because json-1.7.5 conflicts with json (= 1.6.5)
at Specification.raise_if_conflicts(file:/Users/nopik/Documents/Projects/logstash/logstash-1.1.1-monolithic.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/specification.rb:1637)
at Specification.activate(file:/Users/nopik/Documents/Projects/logstash/logstash-1.1.1-monolithic.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/specification.rb:746)
at (Anonymous).try_activate(file:/Users/nopik/Documents/Projects/logstash/logstash-1.1.1-monolithic.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:212)
at Kernel.require(file:/Users/nopik/Documents/Projects/logstash/logstash-1.1.1-monolithic.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:59)
input {
file {
path => "/Users/nopik/Warsztat/logstash/redis.log"
type => "r"
start_position=>"beginning"
}
}
filter {
grok {
@Nopik
Nopik / gist:4484175
Last active December 10, 2015 19:48
In controller:
App.DashboardController = Ember.Controller.extend
workspaces: []
currentWorkspace: null //set by /workspace/:id route
fetch: ->
//ajax load workspaces
// Version: v1.0.0-pre.2-397-gd269fa3
// Last commit: d269fa3 (2013-01-14 21:31:22 -0800)
(function() {
/*global __fail__*/
/**
Ember Debug
@Nopik
Nopik / restler.js
Last active December 14, 2015 21:28
This program (using restler 2.0.1):
restler = require( 'restler' );
r1 = restler.get( 'http://localhost:90/undefined-1', {} )
r1.on( 'error', function(){ console.log( "R1 Error" ); } )
r1.on( 'complete', function(){ console.log( "R1 Complete" ); } )
r2 = restler.get( 'http://localhost:90/undefined-2', {} )
r2.on( 'error', function(){ console.log( "R2 Error" ); } )
@Nopik
Nopik / example.coffee
Created January 23, 2014 11:08
Ember patterns for custom models
#having Foo object, get some item:
item = foo.get( 'items' ).getBy( 'name', 'item1' )
#Feed this item to the view.
#if item is not loaded yet, is has isLoaded = false,
#so you can easily {{#if item.isLoaded}} {{item.name}} {{else}} Please wait, loading {{/if}} in your view
#you can load the item later on. Once deserialize will be called on foo, it will take care to fill in the item1 properties

Keybase proof

I hereby claim:

  • I am Nopik on github.
  • I am nopik (https://keybase.io/nopik) on keybase.
  • I have a public key whose fingerprint is 311B 8E7D 9B37 8ED9 E0F5 FB12 6862 B4E9 3F34 A821

To claim this, I am signing this object:

17201 13:26:57 NopiMac ~/Documents/Projects/puzzle/bosh/goldglory$ bosh validate jobs
Processing deployment manifest
------------------------------
Getting deployment properties from director...
Compiling deployment manifest...
Analyzing release directory...
- discovering packages
- discovering jobs
@Nopik
Nopik / convert.sh
Last active December 21, 2015 10:28
awsm.json to s-function.json
#!/bin/bash
# Name of your lambda
FN=foo
# Absolute path to some s-function file which will be used as template
TEMPLATE=/absolute/path/to/some/s-function.json
jq ".[0].functions.$FN.handler=(.[1].lambda.cloudFormation.Handler | sub(\"aws_\";\"\"))|.[0].functions.$FN.timeout=.[1].lambda.cloudFormation.Timeout|.[0].functions.$FN.memorySize=.[1].lambda.cloudFormation.MemorySize|.[0].functions.$FN.endpoints[0].path=.[1].apiGateway.cloudFormation.Path|.[0].functions.$FN.endpoints[0].method=.[1].apiGateway.cloudFormation.Method|.[0].functions.$FN.endpoints[0].requestParameters=.[1].apiGateway.cloudFormation.RequestParameters|.[0].functions.$FN.endpoints[0].requestTemplates=.[1].apiGateway.cloudFormation.RequestTemplates|.[0].functions.$FN.endpoints[0].responses=.[1].apiGateway.cloudFormation.Responses|.[0]" --slurp $TEMPLATE awsm.json >s-function.json
git add s-function.json