Skip to content

Instantly share code, notes, and snippets.

Riccardo Attilio Galli riquito

Block or report user

Report or block riquito

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
alekseykulikov /
Last active Jan 21, 2020
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

jmindek / gist:62c50dd766556b7b16d6
Last active Apr 7, 2020
DISTINCT ON like functionality for Redshift
View gist:62c50dd766556b7b16d6

distinct column -> For each row returned, return only the unique members of a set. Think of it as for each row in a projection, concatenate all the column values and return only the strings that are unique.

test_db=# SELECT DISTINCT parent_id, child_id, id FROM test.foo_table ORDER BY parent_id, child_id, id LIMIT 10;
parent_id | child_id | id
1000040 | 103 | 1000040|2645405726|0001|103
mickaelandrieu /
Last active Sep 23, 2019
Complete migration guide from Symfony 2.3 LTS to Symfony 2.7 LTS

From Symfony 2.3 to Symfony 2.7: the complete guide


  • assume your code doesn't use any deprecated from versions below Symfony 2.3
  • update dependencies from 2.3 to 2.7
  • do not support "deprecated", be "Symfony3-ready"
  • list tasks component by component, bundle by bundle.
View KinveyCollection.js
// Credentials for use with Kinvey
// NOTE: This example shows passing in the master secret.
// In a production environment, these credentials should be protected i.e.
// they should be requested from the user or secured via a login screen
var kinvey_app_key = 'kidxxxx';
var kinvey_secret = 'master secret';
// Modified sync to add authorization header for use with Kinvey
var authenticatedKinveySync = function(method, model, options) {
psychemedia / feedAutodiscoveryViaJavascript.html
Created Aug 31, 2011
Feed Autodiscovery using Javascript, the Google feed API and YQL
View feedAutodiscoveryViaJavascript.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Feed Autodiscovery</title>
<script src="" type="text/javascript"></script>
<script type="text/javascript">
google.load("feeds", "1");
google.load("jquery", "1.6.2");
louisremi / animLoopX.js
Created Jul 29, 2011
Animation loop with requestAnimationFrame
View animLoopX.js
// Cross browser, backward compatible solution
(function( window, Date ) {
// feature testing
var raf = window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.msRequestAnimationFrame ||
window.animLoop = function( render, element ) {
var running, lastFrame = +new Date;
View regex-weburl.js
// Regular Expression for URL validation
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
// Copyright (c) 2010-2018 Diego Perini (
You can’t perform that action at this time.