Skip to content

Instantly share code, notes, and snippets.

View firecall's full-sized avatar

Alex Counsell firecall

View GitHub Profile
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@Abizern
Abizern / NSData+Base64.h
Created January 19, 2012 22:52
A category on NSData for coding and encoding Base64
//
// NSData+Base64.h
// base64
//
// Created by Matt Gallagher on 2009/06/03.
// Copyright 2009 Matt Gallagher. All rights reserved.
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software. Permission is granted to anyone to
@muxcmux
muxcmux / version.rake
Created February 12, 2012 02:53
Manage your rails app version with this rake task
def valid? version
pattern = /^\d+\.\d+\.\d+(\-(dev|beta|rc\d+))?$/
raise "Tried to set invalid version: #{version}".red unless version =~ pattern
end
def correct_version version
ver, flag = version.split '-'
v = ver.split '.'
(0..2).each do |n|
v[n] = v[n].to_i
@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
@roolo
roolo / mysql2-gem-install.sh
Last active December 25, 2018 07:43
Fixing "Incorrect MySQL client library version! This gem was compiled for 5.5.29 but the client library is 5.6.10. (RuntimeError)" on OS X while using Brew
ARCHFLAGS="-arch x86_64" gem install mysql2 -- –with-mysql-config=/usr/local/bin/mysql_config
//
// NSData+Base64.h
// base64
//
// Created by Matt Gallagher on 2009/06/03.
// Copyright 2009 Matt Gallagher. All rights reserved.
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software. Permission is granted to anyone to
@jaicab
jaicab / responsive-video.css
Last active July 29, 2023 02:52
Pure CSS solution for embed videos with an aspect ratio of 16:9
.video-container {
position: relative;
padding-bottom: 56.25%; /*16:9*/
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
@natelandau
natelandau / .bash_profile
Last active March 20, 2024 22:19
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@jpbalarini
jpbalarini / rails_dev.md
Last active January 26, 2020 12:37
Mac OS Sierra Rails development

How to configure your Mac OS for Ruby on Rails development

  1. Install Sublime Text from here
  2. Install Xcode from the AppStore
  3. Open Xcode and accept the licence
  4. Install command line tools. From the terminal run:
    xcode-select --install
    
  5. Install homebrew