Skip to content

Instantly share code, notes, and snippets.

View jpdicosola's full-sized avatar

John-Patrick Di Cosola jpdicosola

View GitHub Profile
# How to find out where a method comes from.
# Learned this from Dave Thomas while teaching Advanced Ruby Studio
# Makes the case for separating method definitions into
# modules, especially when enhancing built-in classes.
module Perpetrator
def crime
end
end
class Fixnum
mklink /D ".\WindowsPowershell" ".\My Dropbox\PowershellProfile"
@domgreen
domgreen / gist:961492
Created May 8, 2011 16:50
powershell commands
powershell Set-ExecutionPolicy RemoteSigned -Force
powershell -ExecutionPolicy Unrestricted .\CreateEventLog.ps1
@coreyhaines
coreyhaines / .rspec
Last active April 11, 2024 00:19
Active Record Spec Helper - Loading just active record
--colour
-I app
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 25, 2024 14:00
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@johanneswuerbach
johanneswuerbach / .travis.yml
Last active May 14, 2024 03:50
Deploy an iOS app to testflight using Travis CI
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active June 13, 2024 10:59
A badass list of frontend development resources I collected over time.
@ermakovich
ermakovich / CultureInfoExtensions.cs
Last active December 21, 2015 01:39
Extension method for the Silverlight System.Globalization.CultureInfo class, that gets the ISO 639-2 three-letter code for the language of the current System.Globalization.CultureInfo object. It uses ISO-639-2 table (http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt), that is retrieved via Utils.GetResourceStream() custom method. The imp…
using System.IO;
namespace System.Globalization
{
public static class CultureInfoExtensions
{
/// <summary>
/// Gets the ISO 639-2 three-letter code for the language of the current System.Globalization.CultureInfo object.
/// </summary>
/// <param name="cultureInfo"></param>
@lisamelton
lisamelton / transcode-video.sh
Last active May 24, 2024 17:42
Transcode video file (works best with Blu-ray or DVD rip) into MP4 (or optionally Matroska) format, with configuration and at bitrate similar to popular online downloads.
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2015 Don Melton
#
about() {
cat <<EOF
$program 5.13 of April 8, 2015