Skip to content

Instantly share code, notes, and snippets.

View delphaber's full-sized avatar

Fabrizio Monti delphaber

View GitHub Profile
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 31, 2024 07:07
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

@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active May 30, 2024 21:28
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@rozifus
rozifus / Python SimpleHTTPServer with SSL
Last active October 9, 2022 22:40
Python SimpleHTTPServer with SSL
# useful for running ssl server on localhost
# which in turn is useful for working with WebSocket Secure (wss)
# copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@staltz
staltz / introrx.md
Last active May 30, 2024 18:43
The introduction to Reactive Programming you've been missing
@chrisb
chrisb / gist:4d6a09c6cc1ca2e1b14e
Last active November 25, 2022 04:15
Homebrew, Ruby, and Rails on OS X 10.10

OS X 10.10 Guide

Here's what I did to get things working.

1. Install Xcode 6

Yep, over at: https://developer.apple.com

2. Install the Command Line Tools (CLT)

@jberkus
jberkus / gist:6b1bcaf7724dfc2a54f3
Last active January 7, 2024 21:26
Finding Unused Indexes
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
@alecguintu
alecguintu / bm-string-contains-any-in-array.rb
Created April 29, 2014 03:33
Check if string contains any substring in an array in Ruby
require 'benchmark'
iterations = 1_000_000
words = 'foo, bar, test, boo'.split(',').map(&:strip)
string = 'this is going foo be awesome~!'
Benchmark.bmbm do |bm|
bm.report do
iterations.times do
words.any? { |s| string.include?(s) }
end
@Arkham
Arkham / vimrc
Created March 24, 2014 16:50
Convert old rspec should syntax to new expect syntax
function! ConvertShouldToExpect()
let rspec_conversions = {
\ 'should': 'to',
\ 'should_not': 'not_to',
\ 'should_receive': 'to receive',
\ 'should_not_receive': 'not_to receive',
\ }
for [old, new] in items(rspec_conversions)
execute "normal! " . ':%s/\v^(\s+)(.+)\.' . old . '>/\1expect(\2).' . new . '/ge' . "\<CR>"
@brodock
brodock / zurb-chosen.css.scss
Last active August 29, 2015 13:57
This is Chosen stylesheet to use with ZURB Framework 5 (it expects to have @import "foundation" before this file is imported)
@import "chosen";
.chosen-container {
font-size: inherit;
margin-bottom: $form-spacing;
.chosen-single div {
background: none;
border-left: none;
position: absolute;