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
make: *** [rdoc] Abort trap | |
[2010-08-26 23:56:31] make | |
/Users/jjulian/.rvm/gems/ruby-1.8.7-p160/gems/rdoc-2.4.3/lib/rdoc/rdoc.rb:51: warning: already initialized constant GENERATORS | |
error loading "/Users/jjulian/.rvm/gems/ruby-1.8.7-p160/gems/sdoc-0.2.20/lib/rdoc/discover.rb": superclass mismatch for class Paragraph (TypeError) | |
/Users/jjulian/.rvm/gems/ruby-1.8.7-p160/gems/rdoc-2.4.3/lib/rdoc/rdoc.rb:51: warning: already initialized constant GENERATORS | |
/Users/jjulian/.rvm/gems/ruby-1.8.7-p160/gems/json-1.4.3/lib/json/common.rb:66: [BUG] unknown type 0x22 (0xc given) | |
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] |
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
<div class="editable"> | |
<p>Several things to notice here:</p> | |
<p>First, if the browser supports .addEventListener(..) we need to do a little extra work to support mouseenter/mouseleave.</p> | |
<p>But (and I can't stress this enough), this concept is absolutely flawed! We're assuming that if the browser supports .addEventListener(..) then it must not support mouseenter/mouseleave.</p> | |
<h1 class="nubbin_wrapper">Hello!</h1> | |
<p>While this happens to be true at present (to the best of my knowledge) it's unwise to assume that this will always be the case. The problem is, there is no (highly reliable) way to determine whether or not a browser supports a particular event (at least not that I know of). I'm okay with this approach for now, only because we're writing the code in such a way, that even if a browser did support mouseenter/mouseleave, our custom implementation of it shouldn't cause any major problems.</p> | |
</div> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text |
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
#!/usr/bin/env ruby | |
require 'cgi' | |
# EDIT ME! PATH TO YOUR jslint.js file | |
lint = `java org.mozilla.javascript.tools.shell.Main ~/Library/JSLint/jslint.js "$TM_FILEPATH"` | |
lint.gsub!(/^(Lint at.+?:)(.+?)\n(?:(.+?)\n\n)?/m) do | |
"<p><strong>#{CGI.escapeHTML($1)}</strong>#{CGI.escapeHTML($2)}</p>" << | |
($3 ? "<pre>#{CGI.escapeHTML($3)}</pre>" : '') | |
end |
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
def handle_approved(handle) | |
allowed = YAML::load_file('/var/www/allowed.yml') | |
allowed.include?(handle.downcase) | |
end | |
# in the action, after the twitter handle is pulled from oauth | |
if !handle_approved(handle) | |
reset_session | |
flash[:notice] = 'Sorry, your username is not allowed' | |
logger.error "denied access for #{handle}" |
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 | |
$dbhost = 'localhost'; | |
$dbuser = 'root'; | |
$dbpass = ''; | |
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); | |
mysql_select_db('myapp_development'); | |
$query = empty($_GET['query']) ? '' : $_GET['query']; | |
$rows = mysql_query("SELECT * FROM users where username like '%$query%' ORDER BY created_at DESC"); |
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> | |
<link rel="stylesheet" href="ext-3.1.1/resources/css/ext-all.css" /> | |
<script src="ext-3.1.1/adapter/ext/ext-base.js"></script> | |
<script src="ext-3.1.1/ext-all-debug.js"></script> | |
<script> | |
Ext.BLANK_IMAGE_URL = 'ext-3.1.1/resources/images/default/s.gif'; | |
Ext.onReady(function(){ | |
var personStore = new Ext.data.ArrayStore({ | |
fields: ['id', 'name', 'image', 'city', 'country'], |
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
require 'spec_helper' | |
describe Base58 do | |
it "should handle creating encoded strings over 2 characters long" do | |
(1..100000).each do |i| | |
i.should encode_and_decode_to(i) | |
end | |
end | |
end |
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> | |
<link rel="stylesheet" href="ext-3.1.1/resources/css/ext-all.css" /> | |
<script src="ext-3.1.1/adapter/ext/ext-base.js"></script> | |
<script src="ext-3.1.1/ext-all-debug.js"></script> | |
<script> | |
Ext.BLANK_IMAGE_URL = 'ext-3.1.1/resources/images/default/s.gif'; | |
// ...your grid code... | |
//grid.render('grid-example'); <- do not render the grid, the viewport will do this for you | |
Ext.onReady(function(){ |
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
var ourStore = new Ext.data.JsonStore({ //change to JsonStore | |
url:'Chapter15Example.json', | |
root:'files', //add root here | |
fields: [ //add fields here | |
{name:'file_name',mapping:'name'}, | |
{name:'file_size',mapping:'size',type:'int'}, | |
'type', | |
{name:'lastmod',mapping:'datelastmodified',type:'date'}, | |
{name:'file_attributes',mapping:'attributes'}, //these last few fields are not in the source json | |
'mode', |
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
# To rewrite server subdomains into directories: Capture the subdomains | |
# in a rewrite condition, then use backreferences to them in the rule. | |
# . run apache locally | |
# . add project.client.staging.domain.com to /etc/hosts | |
# . curl project.client.staging.domain.com | |
# . in rewrite_log, you'll see rewrite '/' -> '/root/staging/client/project' | |
RewriteLogLevel 3 | |
RewriteLog "rewrite_log" | |
RewriteEngine On | |
ServerName project.client.staging.domain.com |