Skip to content

Instantly share code, notes, and snippets.

View riquito's full-sized avatar

Riccardo Attilio Galli riquito

View GitHub Profile
@alekseykulikov
alekseykulikov / index.md
Last active July 17, 2023 10:15
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
jmindek / gist:62c50dd766556b7b16d6
Last active January 31, 2024 15:48
DISTINCT ON like functionality for Redshift

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 April 26, 2022 11:56
Complete migration guide from Symfony 2.3 LTS to Symfony 2.7 LTS

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.
@bhang
bhang / KinveyCollection.js
Created March 12, 2012 20:05
KinveyCollection
// 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 August 31, 2011 12:14
Feed Autodiscovery using Javascript, the Google feed API and YQL
<!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 July 29, 2011 17:34
Animation loop with requestAnimationFrame
// 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;
//
// 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)
//