Skip to content

Instantly share code, notes, and snippets.

View pmcalabrese's full-sized avatar

Pachito Marco Calabrese pmcalabrese

View GitHub Profile
@recto
recto / PythonVirtualenvMac.md
Last active November 9, 2021 09:41
Python 2 and 3 setup with virtualenv on Mac OS X

Python Installation

You can install the latest python 2 and python 3 by homebrew.

  • Python 2 Installation
brew install python
  • Python 3 Installation
@paulirish
paulirish / what-forces-layout.md
Last active May 23, 2024 14:12
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 24, 2024 06:43
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@belovictor
belovictor / gist:76e696c06b7c239447ea
Created January 19, 2015 20:57
cc3200 Energia sketch with WiFi and MQTT
#include <Wire.h>
#include <WiFi.h>
#include <PubSubClient.h>
#include <Adafruit_TMP006.h>
char ssid[] = "<WiFi SSID>";
char pass[] = "<WiFi key>";
int status = WL_IDLE_STATUS;
IPAddress ip;
// MQTTServer to use
@esfand
esfand / typescript_angular.adoc
Last active September 30, 2022 12:37
AngularJS with TypeScript
@xeoncross
xeoncross / ajax.js
Last active August 3, 2023 06:06
Simple, cross-browser Javascript POST/GET xhr request object. Supports request data and proper AJAX headers.
/**
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object
*
* @param string url
* @param object callback
* @param mixed data
* @param null x
*/
function ajax(url, callback, data, x) {
try {
@amite
amite / laravel deploy.sh
Created November 4, 2013 05:17
laravel deploy on digitalocean
#!/usr/bin/env bash
echo "--- Good morning, master. Let's get to work. Installing now. ---"
echo "--- Updating packages list ---"
sudo apt-get update
echo "--- MySQL time ---"
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@mudge
mudge / eventemitter.js
Last active April 29, 2024 07:48
A very simple EventEmitter in pure JavaScript (suitable for both node.js and browsers).
/* Polyfill indexOf. */
var indexOf;
if (typeof Array.prototype.indexOf === 'function') {
indexOf = function (haystack, needle) {
return haystack.indexOf(needle);
};
} else {
indexOf = function (haystack, needle) {
var i = 0, length = haystack.length, idx = -1, found = false;
@trtg
trtg / blink.c
Last active October 27, 2020 18:10
msp430 launchpad sample code to blink LED 1
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"