Skip to content

Instantly share code, notes, and snippets.

View stramargio's full-sized avatar

Andrea Margiovanni stramargio

View GitHub Profile

A good commit message looks like this:

Header line: explaining the commit in one line

Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc etc.

The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
using System;
namespace Extensions
{
public static class TryParseOrElseExtension
{
public static int TryParseOrElse(this string value, int orElse)
{
try {
return int.Parse(value);
@stramargio
stramargio / Article.md
Created July 28, 2016 10:52 — forked from Warry/Article.md
How to make faster scroll effects?

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

@stramargio
stramargio / 0_reuse_code.js
Created May 10, 2016 18:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@stramargio
stramargio / Run in LOCAL terminal...
Created February 24, 2016 09:00 — forked from jswartwood/Run in LOCAL terminal...
Automatic Git deploys on Dreamhost
# Replace any brackets with real values
# Try to ssh in to DREAMHOST (ensure it no longer asks for a PW); you may want to restart Terminal
ssh [user]@[host]
cd ~
mkdir [mydomain_com].git
cd [mydomain_com].git
git init --bare
vi hooks/post-receive
# Enter the code from the "post-receive" file (in this gist); save + quit
@stramargio
stramargio / AWS-config.md
Last active August 29, 2015 14:27
Fucking Yes! AWS setup for Wordpress Server

Fucking Yes! AWS setup for Awesome Fast Wordpress Server

Ramblings and notes of my experiments with AWS which I will later turn into more coherent instructions.

Sooo... I'm about to be released into the wild as a free roaming web developer. I won't have the company hosting anymore and it's damn well about time I got my own shit sorted. After a little reading I have decided to give Amazon Web Services a try. So far I am loving it.

I have oooooooodles of control. It's super nerdy and more importantly, it's super fast. Seriously - I had fun.

When I first set this up i tried following some third party tutorials to get a wordpress server setup and running on Amazon Web Services. After some trial and error I found the proper documentation and everything when much more smoothly (I know right)! The AWS docs are very detailed and easy to follow.