Skip to content

Instantly share code, notes, and snippets.

View DavideMontersino's full-sized avatar

Davide Orazio Montersino DavideMontersino

View GitHub Profile
// From http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
// returns a number in the rage of 0 (black) to 255 (White) and to set the foreground color based on the Brightness method
// c is an array where 0 is red, 1 is green, 2 is blue
//rgb values are on a 0 - 255 scale
var colorBrightness = function(c){
return Math.sqrt(
c[0] * c[0] * .241 +
c[1] * c[1] * .691 +
c[2] * c[2] * .068);
#!/bin/bash
#Linux Spotify Ad Mute v2
#Put this script in the directory the "spotify" binary is in (e.g. /usr/share/spotify).
#To open Spotify, run it instead of the "spotify" binary.
#System sound will be muted as soon as an ad plays
#Find updated versions at: http://pcworldsoftware.kilu.net/files/link_spotify-admute.php and/or https://gist.github.com/pcworld
#On Debian, you need the package "pulseaudio-utils" for the command line util "pactl" which used in this script
#
#Update: For newer 0.8.x versions (x>4; such as 0.8.8), use this script: https://gist.github.com/pcworld/3198763/#comment-813440
@DavideMontersino
DavideMontersino / introrx.md
Created October 22, 2015 14:48 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@DavideMontersino
DavideMontersino / .jshintrc
Created November 20, 2015 13:20 — forked from haschek/.jshintrc
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@DavideMontersino
DavideMontersino / Development guidelines.md
Last active June 28, 2018 15:15
A draft on developing guidelines for myself and the teams I work with

Git workflow tutorials

General principles

  1. Prefer automation to guidelines whenever possible, use tools to automate stuff. Do not write style guidelines; instead, embed linter in your projects and pre-commit hooks instead; use commit templates

  2. Create a culture

@DavideMontersino
DavideMontersino / git_quick_reference.md
Last active June 28, 2018 15:15
Git quick reference

Git quick reference

This is a quick reference on how to use git; notice that the shortcut work because of the webo-dotfiles

Clone

Cloning is the operation of retrieving a complete copy of a repository online. Every time you navigate to a project in gitlab, you have access to the repo url (for the webo-dotfiles, for example, the git repo url is git@gitlab.extranet.weborama.com:weborama-nl/webo-dotfiles.git)

git clone <repo url>
@DavideMontersino
DavideMontersino / Dutch words.md
Last active February 18, 2016 20:10
A list of dutch words I want to learn

Belangrijke woorden

  • terug: back
  • sommige: some
  • vroeger: before
  • na, achter: after
  • bewuster: awareness
  • geld: money
  • tegen: to / against
  • eigenlijk: actually
@DavideMontersino
DavideMontersino / modern-js-development-toolset.md
Last active February 15, 2016 14:58
A brief introduction to some more or less modern tools for the js developer
We couldn’t find that file to show.

Git session script

@DavideMontersino
DavideMontersino / private-fork.md
Last active February 27, 2024 12:56
How to fork to a private gitlab instance

Theory:

your git repository can have more than one remote server; In this case we want to have two:

  1. one for our private repository on gitlab (will be the default one, called origin)
  2. one to be connected to the source repo on github, to be able to pull new changes (will be called upstream)

How to make a private fork from github to gitlab