Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Stéphane Bachelier stephanebachelier

🎯
Focusing
View GitHub Profile
View git-flip-last.sh
#!/bin/bash
branch=$(git name-rev --name-only HEAD)
git rebase --onto HEAD~2 HEAD~1 HEAD
git cherry-pick ORIG_HEAD~1
git update-ref refs/heads/$branch $(git rev-parse HEAD)
git checkout --quiet $branch
# Instead of creating an independant bash script with the code above,
# consider simply creating a git alias using the command below.
View app.js
var App = new Backbone.Marionette.Application();
App.addRegions({
main: '#main'
});
App.addInitializer(function() {
console.log('here');
App.main.show(new MainLayout())
});
@stephanebachelier
stephanebachelier / app.js
Created Apr 25, 2014
Marionnette onDomRefresh issue example fix proposal
View app.js
var App = new Backbone.Marionette.Application();
App.addRegions({
main: '#main'
});
App.addInitializer(function() {
App.main.show(new MainLayout())
});
@stephanebachelier
stephanebachelier / config.json
Created May 9, 2014
Draftable articles for winter smith blog
View config.json
{
"plugins": [
"./plugins/paginator.coffee",
"./plugins/draftable_page.coffee",
"wintersmith-livereload"
],
"paginator": {
"perPage": 3
}
}
View data.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View README.md
View foo.diff
diff --git a/src/layout-view.js b/src/layout-view.js
index 9c85195..9064053 100644
--- a/src/layout-view.js
+++ b/src/layout-view.js
@@ -16,6 +16,7 @@ Marionette.LayoutView = Marionette.ItemView.extend({
options = options || {};
this._firstRender = true;
+ this._ensureElement();
this._initializeRegions(options);
View atom-0.157-update-crash.log
Process: Atom [44204]
Path: /Applications/Atom.app/Contents/MacOS/Atom
Identifier: com.github.atom
Version: 0.157.0 (0.157.0)
Code Type: X86-64 (Native)
Parent Process: launchd [231]
Responsible: Atom [44204]
User ID: 501
Date/Time: 2014-12-17 00:38:05.517 +0100
View index.html
<nav id="navigation" data-role="navigation">
<ul>
<li><a href="#" class="link">HTML</a></li>
<li><a href="#" class="link">CSS</a></li>
<li><a href="#" class="link">Javascript</a></li>
</ul>
</nav>
<div id="#playground">
<ul>
@stephanebachelier
stephanebachelier / readme.md
Last active Dec 15, 2017 — forked from mikaelleven/readme.md
NodeJS SPI Dump for MCP3008 (and Raspberry Pi)
View readme.md

NodeJS SPI Dump for MCP3008

This is a simple script that reads all eight analog channels of an MCP3008 each second and outputs the result to the console.

I created this script to ease debugging of the MCP3008 ADC connected to my Raspberry Pi.

If you need to troubleshoot the SPI connection in itself you can check out my guide how to test SPI through the loopback "debug mode" https://mikaelleven.wordpress.com/2015/12/10/troubleshooting-spi-on-raspberry-pi-nodejs/.

Installation