Skip to content

Instantly share code, notes, and snippets.

View dannysmith's full-sized avatar

Danny Smith dannysmith

View GitHub Profile
@dannysmith
dannysmith / colour-palette.html
Created December 29, 2010 17:32
A little web page to show colour pallets to clients.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Colour Palette</title>
<style>@media all {section {position:relative;margin-left: 50px;margin-top: 50px;width: 280px;height: 100px;} .bar {position:relative;height: 100%;width: 40px;margin-left: 140px;} .box {position:relative;height: 35px;width: 35px;margin-left: 212px;margin-top: -67px;} p {font-size: 12px;font-style: italic;margin-left: 55px;margin-top:3px;}
#b1 {background: red;}
#b1 .bar {background: green;}
#b1 .box {background: yellow;}
@include gradient-bg(hsl(90, 100, 80));
// Sat:
// how much colour - none to full.
// Lightness:
// How white/black - black to white.
// Hue:
// 0 - Red
// 60 - Yellow
// 120 - Green
// 180 - Cyan
body {
background: #9fbdcf;
}
h1 {
font-size: 6em;
font-family: "Sprint";
color: rgba(84, 128, 154, 0.5);
text-shadow: 0px 1px 4px rgba(255,255,255,0.6),
@dannysmith
dannysmith / grid.html
Created June 5, 2012 16:11
Simple responsive grid
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Grid</title>
<style type="text/css">
body { padding: 0; margin: 0; background: rgba(0,75,0,0.2); font: 10px/1.5em Helvetica, sans-serif; color: #555;}
#wrapper {
@dannysmith
dannysmith / gist:3021709
Created June 30, 2012 01:38 — forked from ambar/gist:1534274
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@dannysmith
dannysmith / google-results.rb
Last active December 10, 2015 17:38
Get the number of google results for each word in a list of words.
#google-results.rb
require 'nokogiri'
require 'open-uri'
require 'uri'
rstr, q_list = [], []
#The list of words
File.open('list.txt').each_line{|s| q_list << URI.escape(s.gsub("\n",''))}
--Fucntions
on add_leading_zeros(this_number, max_leading_zeros)
set the threshold_number to (10 ^ max_leading_zeros) as integer
if this_number is less than the threshold_number then
set the leading_zeros to ""
set the digit_count to the length of ((this_number div 1) as string)
set the character_count to (max_leading_zeros + 1) - digit_count
repeat character_count times
set the leading_zeros to (the leading_zeros & "0") as string
end repeat
--Fucntions
on add_leading_zeros(this_number, max_leading_zeros)
set the threshold_number to (10 ^ max_leading_zeros) as integer
if this_number is less than the threshold_number then
set the leading_zeros to ""
set the digit_count to the length of ((this_number div 1) as string)
set the character_count to (max_leading_zeros + 1) - digit_count
repeat character_count times
set the leading_zeros to (the leading_zeros & "0") as string
end repeat
--Fucntions
on add_leading_zeros(this_number, max_leading_zeros)
set the threshold_number to (10 ^ max_leading_zeros) as integer
if this_number is less than the threshold_number then
set the leading_zeros to ""
set the digit_count to the length of ((this_number div 1) as string)
set the character_count to (max_leading_zeros + 1) - digit_count
repeat character_count times
set the leading_zeros to (the leading_zeros & "0") as string
end repeat
<h2>Homepage Settings</h2>
<label for="home-message">Message</label>
<textarea id="home-message" name="home-message" value="" />
<br /><br /><br />
<h2>Generic SEO</h2>
<p>The following values will be used for your pages titles and meta descriptions:</p>
<table>
<thead>
<tr>