Skip to content

Instantly share code, notes, and snippets.

View Iristyle's full-sized avatar

Ethan J. Brown Iristyle

View GitHub Profile
<html>
<head>
<script src="http://crashkitapp.appspot.com/static/javascript/crashkit-javascript.js?test/js" type="text/javascript" charset="utf-8"></script>
<!-- <script src="http://localhost:5005/static/javascript/crashkit-javascript.js?test/js" type="text/javascript" charset="utf-8"></script> -->
<script src="crashkit-javascript-sample.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
function xxx(a) {
yyy(a, a, a);
}
@gruber
gruber / Liberal Regex Pattern for All URLs
Last active March 20, 2024 20:28
Liberal, Accurate Regex Pattern for Matching All URLs
The regex patterns in this gist are intended to match any URLs,
including "mailto:foo@example.com", "x-whatever://foo", etc. For a
pattern that attempts only to match web URLs (http, https), see:
https://gist.github.com/gruber/8891611
# Single-line version of pattern:
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))
@davidfowl
davidfowl / SolutionFolders.ps1
Created February 21, 2011 10:01
Adding a solution folder via DTE in NuGet
function Add-SolutionFolder {
param(
[string]$Name
)
$solution2 = Get-Interface $dte.Solution ([EnvDTE80.Solution2])
$solution2.AddSolutionFolder($Name)
}
function Get-SolutionFolder {
param (
@caspian311
caspian311 / grab-cert
Created March 11, 2011 22:23
Grab the public certificate from a remote https server to be installed into your ~/.pki/nssdb database for use by Google Chrome and whoever else looks there for certs.
#!/bin/bash
read -p "host (example: www.google.com): " HOSTNAME
read -p "port[443]: " PORT
if [ -n $PORT ]; then
PORT=443
fi
echo 'Q' | openssl s_client -connect $HOSTNAME:$PORT -showcerts 2>&1 | sed -n '/BEGIN CERTIFICATE/,/END CERTIFICATE/p' > /tmp/server.cert.file.pem
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@jstangroome
jstangroome / CLR4PowerShell.psm1
Created March 23, 2011 02:51
Execute individual PowerShell v2 commands using .NET Framework CLR 4
function Invoke-CLR4PowerShellCommand {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[ScriptBlock]
$ScriptBlock,
[Parameter(ValueFromRemainingArguments=$true)]
[Alias('Args')]
[object[]]
@spara
spara / postgres-ubuntu-ec2-install.sh
Created March 23, 2011 02:54
Install script for PostgreSQL/PostGIS on Canonical Ubuntu EC2 AMI with tables EBS RAID 10
#!/usr/bin/env bash
################################################################
#
# Amazon EC2 PostGIS 1.5 on RAID10,f2 EBS Array Build Script
#
# Complete Rip off of:
# http://github.com/tokumine/ebs_raid_postgis/blob/master/build.sh
# http://alestic.com/2009/06/ec2-ebs-raid
# http://biodivertido.blogspot.com/2009/10/install-postgresql-84-and-postgis-140.html
#
@jstangroome
jstangroome / Msi.psm1
Created April 11, 2011 04:43
Read the ProductVersion from a Windows Installer MSI file via PowerShell
function Get-MsiProductVersion {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[ValidateScript({$_ | Test-Path -PathType Leaf})]
[string]
$Path
)
@jedi4ever
jedi4ever / gist:944216
Created April 27, 2011 13:08
build .deb for redis via fpm
VERSION=2.2.5
apt-get -y install wget
rm -rf redis-$VERSION
wget http://redis.googlecode.com/files/redis-2.2.5.tar.gz -O redis-$VERSION.tar.gz
tar -xzvf redis-$VERSION.tar.gz
cd redis-$VERSION
./configure --prefix=/usr
make
rm -rf /tmp/redis-$VERSION.$$
mkdir /tmp/redis-$VERSION.$$
@xinmyname
xinmyname / Examples
Created May 21, 2011 21:04 — forked from davidfowl/Examples
Powershell function that recursively walks all project items within a project and lets you execute an action on each one
# Print all project items
Recurse-Project -Action {param($item) "`"$($item.ProjectItem.Name)`" is a $($item.Type)" }
# Function to format all documents based on https://gist.github.com/984353
function Format-Document {
Recurse-Project -Action { param($item)
if($item.Type -eq 'Folder' -or !$item.Language) {
return
}