Skip to content

Instantly share code, notes, and snippets.

@murilopolese
murilopolese / strawrm.js
Created March 19, 2015 23:26
Strawbees arm servo calculations
var l = 17;
var toDegrees = function( radians ) {
return radians * ( 180 / Math.PI );
}
var toRadians = function( degrees ) {
return degrees * ( Math.PI / 180 );
}
// Polar magnitude
@murilopolese
murilopolese / scroll.js
Created December 2, 2014 15:58
JQuery Page Scroll
var body = $("html, body");
body.animate({scrollTop:0}, '500', 'swing', function() {
alert("Finished animating");
});
@murilopolese
murilopolese / package.json
Last active October 25, 2016 23:25
Simplest static file node server (Heroku ready)
{
"name": "http-server-app",
"version": "0.0.1",
"description": "",
"scripts": {
"start": "./node_modules/.bin/http-server"
},
"dependencies": {
"http-server": "*"
},
@murilopolese
murilopolese / editthispage
Created October 22, 2014 22:37
MdWiki Edit this page link
$(document).ready(function(){
var hash = window.location.hash.replace('#!', '' );
var locale = window.location.pathname.replace('/wiki/', '');
var github = 'https://github.com/KidsHackDay/wiki/edit/gh-pages/';
var link = $( '<a/>', {
href: github + locale + hash,
text: 'Edit this page'
});
var container = $( '<div/>', {
'class': 'container'
@murilopolese
murilopolese / yolo
Last active August 29, 2015 14:06
Yolo Deploy
#!/bin/bash
git add -A && git commit -m "yolo" && git push $1 $2
@murilopolese
murilopolese / console.sailing.js
Created September 11, 2014 12:23
I miss sailing
console.sailing = function () {
var pos = 0;
setInterval( function() {
clear();
var line1 = '';
var line2 = '';
for( var i = 0; i < pos; i++ ) {
line1 += ' ';
line2 += ' ';
}