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
gem("thin") | |
gem("bcrypt-ruby", version:"~> 3.0.0") | |
gem("heroku") | |
gem("gravatar_image_tag") | |
gem("kaminari") | |
gem("bourbon", group: 'assets') | |
gem("annotate", group: 'development', :git => 'git://github.com/ctran/annotate_models.git') | |
gem("ffaker", group: 'development') | |
if yes?("Would like to install Zurb Foundation?") |
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 classData(ReflectionClass $class) | |
{ | |
$details = ""; | |
$name = $class->getName(); | |
if ($class->isUserDefined()) | |
{ | |
$details .= "$name is user defined\n"; | |
} | |
if ($class->isInternal()) |
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 ReflectionUtil | |
{ | |
static function getClassSource(ReflectionClass $class) | |
{ | |
$path = $class->getFileName(); | |
$lines = @file($path); | |
$from = $class->getStartLine(); | |
$to = $class->getEndLine(); | |
$len = $to-$from+1; | |
return implode(array_slice($lines, $from-1, $len)); |
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
$my_class = new ReflectionClass('MyClass'); | |
$methods = $my_class->getMethods(); | |
foreach ($methods as $method) | |
{ | |
print methodData( $method ); | |
print "\n----\n"; | |
} |
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 ReflectionUtil | |
{ | |
static function getMethodSource(ReflectionMethod $method) | |
{ | |
$path = $method->getFileName(); | |
$lines = @file($path); | |
$from = $method->getStartLine(); | |
$to = $method->getEndLine(); | |
$len = $to-$from+1; | |
return implode(array_slice( $lines, $from-1, $len)); |
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
$my_class = new ReflectionClass('MyClass'); | |
$method = $my_class->getMethod("__construct"); | |
$params = $method->getParameters(); | |
foreach ($params as $param) | |
{ | |
print argData($param); | |
} |
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
$navLinks.click(function(event) { | |
var pos1, pos2, hash, start, end, total, time, | |
$this = $(this), | |
offset = $($this.attr('href')).offset().top, | |
pos1 = $this.offset().top, | |
hash = event.currentTarget.hash.toString(), | |
pos2 = $(hash.toString()).offset().top, | |
$target = $('html, body'); | |
start = parseInt(pos1); | |
end = parseInt(pos2); |
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
SELECT | |
SUBSTRING_INDEX(column_name, ',', -1) | |
AS xxx | |
FROM table_name | |
WHERE 1 | |
GROUP BY | |
SUBSTRING_INDEX(column_name, ',', -1) | |
ASC |
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
DELETE | |
FROM table_child | |
WHERE NOT EXISTS ( | |
SELECT table_parent.id | |
FROM table_parent | |
WHERE table_child.id = table_parent.id) |
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
/**********************************************/ | |
/* | |
/* IR_Black Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Todd Werth's IR_Black: | |
/* http://blog.toddwerth.com/entries/2 | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |