Skip to content

Instantly share code, notes, and snippets.

View charliepark's full-sized avatar
🚀

Charlie Park charliepark

🚀
View GitHub Profile
@charliepark
charliepark / padrino_template.rb
Created July 25, 2011 11:03
A template for kickstarting Padrino apps.
project :orm => :datamapper, :script => :jquery, :renderer => :erb
git :init
git :add, "."
git :commit, "initial commit"
@charliepark
charliepark / random_string.rb
Created July 25, 2011 11:15
Ruby code to create a random string, with no confusable digits (no "0 / O", "1 / I / l", "5 / S", "8 / B" crosses, etc.).
def generate_domain_key
charset = %w{ 2 3 4 6 7 9 A C D E F G H J K L M N P Q R T V W X Y Z}
(0...16).map{ charset[rand(charset.size + 1)] }.join
end
@charliepark
charliepark / hatchshow.js
Created July 30, 2011 16:07
A jquery typography plugin.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(window).load(function(){
$().hatchShow();
});
jQuery.fn.hatchShow = function(){
$('.hsjs').css('display','inner-block').css('white-space','pre').each(function(){
var t = $(this);
t.wrap("<span class='hatchshow_temp' style='display:block'>");
var pw = t.parent().width();
@charliepark
charliepark / refactor.rb
Created August 5, 2011 15:01
Just some refactored code. Nothing special.
@first_month = 5
@last_month = 8
@year_for_first_month = 2009
@year_for_last_month = 2011
# the old code:
(@year_for_first_month..@year_for_last_month).each do|year|
@charliepark
charliepark / grayscale.txt
Created October 25, 2011 15:20
A nice span of grays. White, black, and three grays.
http://www.colourlovers.com/palette/1824236/5-Step_Value_Scale
Color (Hex) Lowlight (Hex) Color (RGB)
#000000 #000000 0, 0, 0
#404040 #393939 64, 64, 64
#808080 #727272 128, 128, 128
#C0C0C0 #ACACAC 192, 192, 192
#FFFFFF #E5E5E5 255, 255, 255
@charliepark
charliepark / bootstrap_buttons.less
Created February 2, 2012 00:35 — forked from tgriesser/bootstrap_buttons.less
A Less Implementation of the Bootstrap Buttons Generator
.customButton(@cHue: 201, @cSaturation: 1, @cLightness: .4, @cDelta: .1, @cMultiplier: 1.5) {
.cTextColor(@a, @b) when (@a < .5) { color: #fff; .cAlphaShadow(0, -1, 1, 0, (@b * 3.3)); }
.cTextColor(@a, @b) when (@a > .5) { color: #333; .cAlphaShadow(0, 1, 1, 255, (@b * 3.3)); }
.cTextColor(@a) { -webkit-font-smoothing: antialiased; }
.cAlphaShadow(@a, @b, @c, @d, @e) when (@e > 1) { text-shadow: (0px + @a) (0px + @b) (0px + @c) rgba(@d, @d, @d, 1); }
.cAlphaShadow(@a, @b, @c, @d, @e) when (@e < 1) { text-shadow: (0px + @a) (0px + @b) (0px + @c) rgba(@d, @d, @d, @e); }
@cHighlight: percentage(@cLightness + @cDelta);
@cLowlight: percentage(@cLightness - @cDelta);
@cSuperLowLight: percentage(@cLightness - @cDelta * @cMultiplier);
@charliepark
charliepark / bookmark.css
Created May 23, 2012 15:43
A really simple bookmark representation in CSS. Extracted from code for Monotask.com
.bookmark{
background: #b00;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b00), color-stop(100%,#900));
background-image: -webkit-linear-gradient(top, #b00 0%, #900 100%);
background-image: -moz-linear-gradient(top, #b00 0%, #900 100%);
background-image: -o-linear-gradient(top, #b00 0%, #900 100%);
background-image: -ms-linear-gradient(top, #b00 0%, #b00 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b00', endColorstr='#900',GradientType=0 );
background-image: linear-gradient(top, #b00 0%, #900 100%);
@charliepark
charliepark / stringContains.js
Created June 29, 2012 13:22
A one-line js snippet to see if String A contains Substring B (call with "string".contains("str"); returns true or false)
String.prototype.contains = function(substring){
return this.indexOf(substring) != -1;
};
@charliepark
charliepark / GitHub Pages For Projects When You Already Have a GitHub User Page-Blog
Created July 16, 2012 15:25
How to get GitHub Pages for projects, while maintaining your root Jekyll page.
How to get GitHub Pages for projects, while maintaining your root Jekyll page.
This is a good start ... https://help.github.com/articles/creating-project-pages-manually
In this case, I'm getting Parentheticals posted as a GitHub Project Page
cd into your local copy:
$ cd parentheticals
$ parentheticals
@charliepark
charliepark / available.css
Created July 19, 2012 11:20
Testing to see what gist data is available for public consumption.
body{background:#f4f4f4;color:#444}
a{color:#b00 !important;text-decoration:none}
.randoclass{text-transform:uppercase}