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
alekseykulikov / index.md
Last active Jan 21, 2020
Principles we use to write CSS for modern browsers
View index.md

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
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
mickaelandrieu / upgrade2.3-to-2.7.md
Last active Sep 23, 2019
Complete migration guide from Symfony 2.3 LTS to Symfony 2.7 LTS
View upgrade2.3-to-2.7.md

From Symfony 2.3 to Symfony 2.7: the complete guide

Objectives

  • 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
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Feed Autodiscovery</title>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load("feeds", "1");
google.load("jquery", "1.6.2");
@louisremi
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.oRequestAnimationFrame;
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 (http://www.iport.it)
//
You can’t perform that action at this time.