Skip to content

Instantly share code, notes, and snippets.

View adrienjoly's full-sized avatar
☺️
In the flow

Adrien Joly adrienjoly

☺️
In the flow
View GitHub Profile
@adrienjoly
adrienjoly / makeColorConsole.js
Created February 13, 2014 10:58
add color to console.warn and console.error outputs
var colors = require('colors');
function makeColorConsole(fct, color){
return function(){
for (var i in arguments)
if (arguments[i] instanceof Object || arguments[i] instanceof Array)
arguments[i] = sys.inspect(arguments[i]);
fct(Array.prototype.join.call(arguments, " ")[color]);
};
}
@adrienjoly
adrienjoly / find_dupes.sh
Created April 14, 2014 08:48
recursively find the list of files that have duplicates names
sudo find . "*" -print0 | xargs -0 -I {} basename {} | uniq -d -i >~/dupes.txt
@adrienjoly
adrienjoly / hideAd.js
Created June 12, 2014 15:29
hide a div (and keep it hidden forever) when clicking a "close" link
var COOKIE_DEF = "showAd=0", COOKIE_EXP = 365 * 24 * 60 * 60 * 1000; // 1 year
var display = (document.cookie || "").indexOf(COOKIE_DEF) == -1;
var $ad = $("#myAd").toggle(display);
$ad.find(".removeAd").click(function() {
document.cookie = COOKIE_DEF + "; expires=" + new Date(Date.now() + COOKIE_EXP).toGMTString();
$ad.animate({height:0}, function() {
$(this).remove();
});
});
@adrienjoly
adrienjoly / run.sh
Created June 24, 2014 16:31
Simple HTTP server
# set mac osx's terminal title
echo -n -e "\033]0;http server\007"
# make sure to switch to the script's dir (e.g. when launched via mac osx's finder)
cd `dirname "$0"`
python -m SimpleHTTPServer
@adrienjoly
adrienjoly / software-release-pledge.md
Last active August 29, 2015 14:19
Software Release Pledge

Software Release Pledge

Short description: This Pledge is a commitment by software makers to empower their users with the capabilities of keeping using the software, even if it was to be discontinued.

If our founding team ever comes to discontinue development and/or maintenance of our product (or service), we pledge:

  • to inform our users at least 2 weeks before the product (or service) can no longer be used;
  • and to propose a solution for them to keep using the product (or service).

These solutions include (but are not limited to): opening the source code of the product (or service), selling the Internet domain name and working server infrastructure without profit, or at least providing a way to migrate all user data and functionalities to another product (or service) for users who want it.

@adrienjoly
adrienjoly / .gitconfig
Last active August 29, 2015 14:19 — forked from yereby/.gitconfig
[user]
name = "Jérémy Giuseppi"
email = yereby@gmail.com
[credential]
helper = cache
[color]
branch = auto
diff = auto
interactive = auto
status = auto
@adrienjoly
adrienjoly / popinOnHover.js
Last active August 29, 2015 14:19
jquery-based function for displaying a popin/menu on hover
// generic function for displaying a menu element when hovering on an other element
function popinOnHover(hoverElement, menuElementOrFunction){
var $menuElement = typeof menuElementOrFunction !== 'function' ? $(menuElementOrFunction) : null;
var hoveredZones = 0;
function hideIfNotHovered(){
if (!hoveredZones){
if (typeof menuElementOrFunction === 'function') {
$menuElement = menuElementOrFunction(false);
}
else
@adrienjoly
adrienjoly / reply-to-facebook-playem-app-review.md
Last active August 29, 2015 14:20
My reply to Facebook's rejection of my submission of app review for Play'em

Your decision to grant read_stream and user_group only to Facebook-branded clients on platforms where Facebook is not already available seems legit, even though I don't know any client or platform that is not supported by Facebook yet.

Nevertheless, it makes me sad to see that this decision will kill my app Play'em. Indeed, the point of Play'em is only to play videos shared by our Facebook friends, so it's a novel way to consume Facebook news. In my opinion, my app is not a threat for Facebook, nor its users. It's the contrary. It's a missing feature that I'm providing for free, without storing any information from Facebook!

That's why it makes me sad that you're killing it.

@adrienjoly
adrienjoly / sample-devops-file.md
Last active August 29, 2015 14:20
(Sample) Project devops file: Server Maintenance & Troubleshooting

(Sample) Project devops file: Server Maintenance & Troubleshooting

Project topology

  • lucyJS: node.js server that handles HTTP requests for the web and iPhone clients
  • kinderDB: mongoDB database that stores user-generated content + metrics
  • nginx: reverse-proxy that maps our subdomains and ports to the right services, caches static files, and transforms HTTPS requests into HTTP

Domain/port mappings

@adrienjoly
adrienjoly / sample-project-readme.md
Created April 29, 2015 15:08
(Sample) Project Readme.md

(Sample) Project Readme.md

Prerequisites

Project setup