This file contains hidden or 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
# https://github.com/visionmedia/user-agent | |
agent = Agent.new request.user_agent | |
User.os_name = agent.os | |
User.count(:conditions => "os_name = 'OS X' OR os_name = 'OS X 10.4' OR os_name = 'OS X 10.5' OR os_name = 'OS X 10.6' OR os_name = 'OS X 10.7'") | |
User.count(:conditions => "os_name = 'Windows 7' OR os_name = 'Windows Vista' OR os_name = 'Windows 2000' OR os_name = 'Windows XP' OR os_name = 'Windows 2003'") |
This file contains hidden or 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
heroku console User.last.update_attribute :credits,"42" --app YOUR_APP_NAME |
This file contains hidden or 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
# find the reference here -> http://www.highcharts.com/ref | |
# github.com/michelson/lazy_high_charts | |
require "lazy_high_charts" | |
class CreateGraph | |
def init() | |
mess = [] |
This file contains hidden or 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
curl http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/de/ch0[1-9].html -o "ch0#1.html" |
This file contains hidden or 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 | |
function GetTimeDiff($timestamp) | |
{ | |
$how_log_ago = ''; | |
$seconds = time() - $timestamp; | |
$minutes = (int)($seconds / 60); | |
$hours = (int)($minutes / 60); | |
$days = (int)($hours / 24); | |
if ($days >= 1) { | |
$how_log_ago = $days . ' day' . ($days != 1 ? 's' : ''); |
This file contains hidden or 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
for i in `seq 1 26`; do wget "http://identi.ca/api/statuses/user_timeline.xml?screen_name=peponi&count=200&page=${i}" -O stream-${i}.xml ; sleep 2; done ; |
This file contains hidden or 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 | |
public function post_some_crap() | |
{ | |
$result = Input::get(); | |
/* ============= just a smal data maper snippit ================= */ | |
// replace the table name in ::query('show columns from <tablename> '); | |
// got all rows as index from table |
This file contains hidden or 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
// create an two dimension array | |
function Create2DArray(rows) { | |
var arr = []; | |
for (var i=0;i<rows;i++) { | |
arr[i] = []; | |
} | |
return arr; | |
} |
This file contains hidden or 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
/* checkbox multiline label align correction */ | |
label { | |
position:relative; | |
padding-left:22px; | |
display:block; | |
} | |
label input[type=checkbox] { | |
position:absolute; | |
top:2px; |
This file contains hidden or 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
<html> | |
<head> | |
<title></title> | |
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script> | |
<style> | |
.edit{width: 100px;margin-left:20px;} | |
input | |
{ |
OlderNewer