Skip to content

Instantly share code, notes, and snippets.

@gcatlin
gcatlin / gist:1847248
Created February 16, 2012 19:43
Install specific version of Homebrew formula
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@Dreyer
Dreyer / mail-test.php
Created June 20, 2012 09:06
Quick & Dirty PHP Mail Test Script
<?php
/*
DONT FORGET TO DELETE THIS SCRIPT WHEN FINISHED!
*/
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = 'webmaster@example.com';
@sybarite
sybarite / gist:2994745
Created June 26, 2012 09:49
Sendmail setup with mailtrap.io

Steps to setup mailtrap.io with your sendmail in ubuntu

Install sendmail and mailutils in ubuntu 'apt-get install sendmail mailutils'

In the terminal go into root prompt with sudo -s

Go to the /etc/mail folder

@gionn
gionn / import.sh
Created June 27, 2012 09:00
Migration script from Windows DNS to PowerDNS
#!/bin/bash
DOMAINARRAY=`cat /mnt/samba/winnt/system32/dns/domainlist`
for domainname in $DOMAINARRAY
do
echo " "
echo "$domainname being imported"
zone2sql --zone=$domainname.dns --gmysql --zone-name=$domainname | mysql -h
10.10.1.1 -D pdns -u pdns
echo "$domainname done!"
@abdev
abdev / gist:3083037
Created July 10, 2012 12:44
Magento - format date from local format to magento internal format
$myDate = '07/10/12';//2012-07-10
$format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
$date = Mage::app()->getLocale()->date(
$myDate,
Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
null,
false
);
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@Tukki
Tukki / gist:3953990
Created October 25, 2012 16:52
filter by time in sqlalchemy
#http://stackoverflow.com/questions/7075828/make-sqlalchemy-use-date-in-filter-using-postgresql
from sqlalchemy import Date, cast
from datetime import date
my_date = (session.query(MyObject)
.filter(cast(MyObject.date_time, Date) == date.today())
.all())
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@fernandoaleman
fernandoaleman / gist:5083680
Last active October 17, 2023 12:02
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.