Skip to content

Instantly share code, notes, and snippets.

View rawsyntax's full-sized avatar

Eric Himmelreich rawsyntax

View GitHub Profile
@rawsyntax
rawsyntax / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
##
# This is the long version...
#
# See the short version here http://gist.github.com/289868
#
Last login: Fri Jan 29 11:04:52 on ttys004
eric@Blondie:~$ ARCHFLAGS='-arch i386 -arch x86_64'
eric@Blondie:~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes
// ==UserScript==
// @name Gmail Growl+Sound+Badge (Fluid/Fluidium SSB)
// @namespace http://userscripts.org/scripts/show/57672
// @description Gmail Growl Notification with Sound Alert and Dock Badge for Fluid
// @include http://mail.google.com/*
// @include http://*.google.com/mail/*
// @include https://mail.google.com/*
// @include https://*.google.com/mail/*
// @author Tom Hensel
// @attribution shellshock (http://userscripts.org/scripts/review/57672), Nicky Leach (http://userscripts.org/scripts/show/56774)
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
.ie6 body {
background-attachment: fixed;
}
//all in the same file!! no more additional files for ie!
.ie7 body {
background-attachment: scroll;
}
begin
require 'fsevent'
rescue LoadError
require 'rubygems'
require 'fsevent'
end
class Puncher < FSEvent
def initialize(command, files)
@rawsyntax
rawsyntax / .bashrc
Created November 3, 2010 15:34
save this file as .bashrc and put in your ~/
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
if [[ -n "$PS1" ]]; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@rawsyntax
rawsyntax / gist:789162
Created January 21, 2011 02:45
an example model (with activemodel validations)
class Example
include ActiveModel::Validations
##
# Validates a URL
#
# If the URI library can parse the value, and the scheme is valid
# then we assume the url is valid
#
class UrlValidator < ActiveModel::EachValidator
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'uri'
URI.parse("кц.рф")
# fails with the following error
#
#/Users/eric/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/uri/common.rb:156:in `split': bad URI(is not
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'addressable/uri'
Addressable::URI.parse("кц.рф")
# no problem at all