Skip to content

Instantly share code, notes, and snippets.

@Nopik
Nopik / main.c
Created September 26, 2018 12:28
nRF52840 crash
/**
* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
@Nopik
Nopik / main.c
Created September 13, 2018 16:27
nRF52840 crash on FreeRTOS
/**
* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
@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
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

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:

@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
@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" ); } )
// 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 / 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
input {
file {
path => "/Users/nopik/Warsztat/logstash/redis.log"
type => "r"
start_position=>"beginning"
}
}
filter {
grok {