Skip to content

Instantly share code, notes, and snippets.

View brpaz's full-sized avatar

Bruno Paz brpaz

View GitHub Profile
@matthewmccullough
matthewmccullough / .zshrc
Created January 20, 2011 00:00
A configuration to maintain history across sessions and share it across terminals in ZShell
##############################################################################
# History Configuration
##############################################################################
HISTSIZE=5000 #How many lines of history to keep in memory
HISTFILE=~/.zsh_history #Where to save history to disk
SAVEHIST=5000 #Number of history entries to save to disk
#HISTDUP=erase #Erase duplicates in the history file
setopt appendhistory #Append history to the history file (no overwriting)
setopt sharehistory #Share history across terminals
setopt incappendhistory #Immediately append to the history file, not just when a term is killed
<?php
class DefaultController extends Controller
{
/**
* Dashboard page.
* @Permissions(perm="dashboard_view")
* @Route("/", name="ITEDashboardBundle_index")
* @Template()
* @return array
@bradland
bradland / gencert.sh
Created January 27, 2012 20:39
Generate a self-signed SSL cert
#!/bin/bash
# Bash shell script for generating self-signed certs. Run this in a folder, as it
# generates a few files. Large portions of this script were taken from the
# following artcile:
#
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html
#
# Additional alterations by: Brad Landers
# Date: 2012-01-27
@nhoffman
nhoffman / pyscript.py
Last active May 8, 2024 14:26
Python script template
#!/usr/bin/env python3
"""A simple python script template.
"""
import os
import sys
import argparse
@kekscom
kekscom / BulkInsert.js
Created July 9, 2012 19:54
MySQL bulk Insert
/**
This little helper creates bulk SQL insert queries like this:
INSERT INTO mytable (id, col1, col2) VALUES
(1, "col1value", "col2value"),
(2, "col1value", "col2value"),
(3, "col1value", "col2value"),
:
:
(4999, "col1value", "col2value"),
@edelbalso
edelbalso / performance_metrics.md
Created July 9, 2012 23:41 — forked from uhhuhyeah/performance_metrics.md
Concepts used in browser-side performance testing

An Important Note

These are the metrics that would be used by the engineering team to evaluate effectiveness of front-end optimizations, and shouldn’t be communicated to stakeholders. Emily’s 90% page loaded metric is a way better model for measurable progress of “page load time”.

Outline

The purpose of this document is to outline the main metrics we use when discussing various end-user performance measurements such as "page speed".

Fig 1) A diagram we have been using in conversations to help illustrate the various events and how they inter-relate.

@ganglio
ganglio / fb.js
Created December 13, 2012 14:39
CasperJS: Facebook photos scraper
var casper = require('casper').create({
verbose : true,
logLevel : 'info'
});
var images = [];
var fs=require("fs")
/**
* Configuration here
*/
@cobyism
cobyism / gh-pages-deploy.md
Last active July 5, 2024 05:07
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@kixorz
kixorz / aws_iam_policy.json
Last active April 11, 2022 10:32
Update Route53 DNS records from your EC2 instance using this simple Ruby script. You can call it from rc.local after setting your hostname locally. First parameter is the desired <hostname>.<domain> Domain and other parameters are hardcoded. This script is useful for handling internal DNS changes in your systems after instance changes. Attached …
{
"Statement": [
{
"Action": [
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListResourceRecordSets"
],
"Effect": "Allow",
"Resource": [
@dajulia3
dajulia3 / listings_controller.rb
Last active March 30, 2023 01:36
Service locator with Rails Initializer for rails service loader that loads the services from a config file.
class ListingsController < ApplicationController
def index
movie_listing_service = ServiceLocator.get_service_instance(:MovieListing)
@available_movies = movie_listing_service.available_movies
render nothing: true #this is just an example don't get hung up on it :)
end