This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To revert to a commit further back than the most recent commit-------- | |
git reset 56e05fced #resets index to former commit; replace '56e05fced' with your commit code | |
git reset --soft HEAD@{1} #moves pointer back to previous HEAD | |
git commit -m "Revert to 56e05fced" | |
git reset --hard #updates working copy to reflect the new commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
An utility object which allows to create different animations with different keyframes. | |
The get_value method return the interpolated value of the selected animation depending on time parameter. | |
### | |
class Tweener | |
constructor: -> | |
@keyframes = new Object() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
border-radius(n) | |
-webkit-border-radius n | |
-moz-border-radius n | |
border-radius n | |
// Math | |
// ------------------------------ | |
floor(n){math(n, 'floor')} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $('img.photo',this).imagesLoaded(myFunction) | |
// execute a callback when all images have loaded. | |
// needed because .load() doesn't work on cached images | |
// Modified with a two-pass approach to changing image | |
// src. First, the proxy imagedata is set, which leads | |
// to the first callback being triggered, which resets | |
// imagedata to the original src, which fires the final, | |
// user defined callback. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
localise_routes: ( ) -> | |
# Deep clone the default routes | |
old_routes = _.cloneDeep @Routes.routes | |
# Create a brand new routes object | |
@Routes.routes = {} | |
# Copy the utility routes | |
@Routes.routes[ "/pages" ] = old_routes[ "/pages" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require("fs") | |
http = require("http") | |
socketio = require("socket.io") | |
public_path = "#{__dirname}/../public" | |
server = http.createServer((req, res) -> | |
res.writeHead 200, "Content-type": "text/html" | |
res.end fs.readFileSync "#{public_path}/index.html" | |
).listen(8765) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage: log('inside coolFunc', this, arguments); | |
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ | |
window.log = function(){ | |
log.history = log.history || []; // store logs to an array for reference | |
log.history.push(arguments); | |
arguments.callee = arguments.callee.caller; | |
if(this.console) console.log( Array.prototype.slice.call(arguments) ); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am stefanoortisi on github. | |
* I am ortisi (https://keybase.io/ortisi) on keybase. | |
* I have a public key whose fingerprint is 4FE9 7C3C BA96 125E 2D1A 0681 2BC5 8974 F5CB 29CE | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
- siraloe.it | |
Script to automatically close the mobile menu when the user scroll the page | |
*/ | |
document.addEventListener("DOMContentLoaded", () => { | |
const handlers = document.querySelectorAll(".hfe-nav-menu__toggle"); | |
let isOpen = false; | |
if (handlers.length < 2) { | |
return; | |
} |