This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ----------------------------------------------------------------- | |
// A very simple jQuery slideshow. It requires a little more work | |
// on the part of the user, but this keeps the transition code tiny. | |
// ----------------------------------------------------------------- | |
// CSS | |
// ----------------------------------------------------------------- | |
#slideshow { width:200px; height:200px; } | |
.hidden { display:none; } | |
// ----------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RUBYGEMS_URL="http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz" | |
RUBYGEMS_FOLDER="rubygems-1.3.1" | |
RUBYGEMS_EXT="tgz" | |
apt-get update | |
apt-get install build-essential ruby ruby1.8-dev wget vim apache2 libopenssl-ruby apache2-prefork-dev rdoc git-core | |
apt-get install sqlite3 libsqlite3-dev | |
apt-get install imagemagick |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function invert_color(color) { | |
color = color.replace('#', ''); | |
r = color.substr(0,2); | |
g = color.substr(2,2); | |
b = color.substr(4,2); | |
inverted_r = 255 - parseInt(r,16); | |
inverted_g = 255 - parseInt(g,16); | |
inverted_b = 255 - parseInt(b,16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#flash_notice { | |
width:400px; | |
padding:10px; | |
background:#dbffca; | |
color:#060; | |
height:30px; | |
line-height:30px; | |
border:1px solid #060; | |
font-family:arial, helvetica, sans-serif; | |
font-size:12pt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> | |
<head> | |
<title>Tabs With Keyboard Shortcuts</title> | |
<style type="text/css"> | |
body { background:#fff; font-family:arial, helvetica, sans-serif; color:#000; font-size:10pt; } | |
#container { width:450px; border:1px solid #3b3b3b; height:200px; } | |
#tabs { margin:0; padding:0; background:#aaa; height:35px; border-bottom:1px solid #3b3b3b; } | |
#tabs li { list-style:none; margin:0; padding:0; display:inline; } | |
#tabs li a { color:#999; font-weight:bold; text-decoration:none; height:25px; line-height:25px; margin-top:5px; border-bottom:1px solid #3b3b3b; padding:0 10px; margin:10px 0 0 10px; float:left; background:#ededed; border-right:2px solid #3b3b3b; outline:none; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
A small script to authenticate to github, check a repo/branch | |
and pull the code if a new commit has been made. It also does | |
an initial pull as soon as it's executed. | |
Dead Simple, but it works. | |
$: cd <your repo> | |
$: php updater.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Image Preview</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script> | |
<style type="text/css"> | |
* { | |
box-sizing: border-box; | |
position: relative; | |
-moz-box-sizing: border-box; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
class SublimeBlockCursor(sublime_plugin.EventListener): | |
def view_is_widget(view): | |
settings = view.settings() | |
return bool(settings.get('is_widget')) | |
def show_block_cursor(self, view): | |
validRegions = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HexColorValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
record.errors[attribute] << (options[:message] || 'is not a valid colour value') unless self.class.matches?(value) | |
end | |
def self.matches?(value) | |
return false unless value | |
/\A#(?:[0-9a-f]{3})(?:[0-9a-f]{3})?\z/i.match(value).nil? ? false : true | |
end | |
end |
OlderNewer