Skip to content

Instantly share code, notes, and snippets.

View electricg's full-sized avatar

Giulia Alfonsi electricg

View GitHub Profile
@electricg
electricg / LICENSE-MIT
Last active March 27, 2024 20:59
Stopwatch in javascript
Copyright (c) 2010-2015 Giulia Alfonsi <electric.g@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
@electricg
electricg / npmlink.md
Created January 16, 2018 22:21
npm link / unlink
@electricg
electricg / personal.md
Last active August 25, 2023 23:10
Apps to install on my laptops
@electricg
electricg / .zshrc
Last active October 11, 2022 18:54
My oh-my-zsh
source /Users/giulia/.bash_profile
source /Users/giulia/.bashrc
ZSH_DISABLE_COMPFIX=true
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/giulia/.oh-my-zsh"
@electricg
electricg / howto.md
Last active February 12, 2022 16:40
How to setup Gandi.net domain routing to Heroku

How to setup Gandi.net domain routing to Heroku

TODO: setup SSL.


This is a quick guide on how to setup domain and infinite subdomains, in a case where, for example, you may have one subdomain for each client.

Starting from this http://stackoverflow.com/a/39646701

@electricg
electricg / mouse.js
Last active April 27, 2021 16:32
Mouse position relative to document and element
// Which HTML element is the target of the event
function mouseTarget(e) {
var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
return targ;
}
@electricg
electricg / epub.md
Created January 28, 2021 17:01
Epub
mkdir test && cd "$_"
tar -xzf ../test.epub
@electricg
electricg / CyanogenMod.md
Created June 22, 2013 14:09
CyanogenMod for Samsung Galaxy S II
@electricg
electricg / noref.php
Created July 31, 2012 10:49
Remove referer and anonymize links
<?php
$url = getenv('QUERY_STRING');
if ($url == '') {
die ('THIS SCRIPT CANNOT BE CALLED DIRECTLY!');
}
?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; URL=<?php echo $url ?>">