Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
// Prints to browser console (Chrome, Firefox), no explicit ifs. Starts from 1. | |
for(i=0;i++<100;console.log([['fizz'][i%3],['buzz'][i%5]].join('')||i)); // 72 characters | |
// Writes to array 'a', no explicit ifs. Starts from 1. | |
for(a,i=0;i<100;a[i++]=([['fizz'][i%3],['buzz'][i%5]].join('')||i)); // 68 characters | |
// Returns an array (Firefox only), no explicit ifs, no explicit loops. Starts from 0. | |
Array.apply([],Array(100)).map((e,i)=>[['fizz'][i%3],['buzz'][i%5]].join('')||i) // 80 characters |
import pymongo | |
from pymongo import Connection | |
from pymongo.dbref import DBRef | |
from pymongo.database import Database | |
# connect | |
connection = Connection() | |
db = Database(connection, "things") | |
# clean up |
@@ -28,7 +28,7 @@ | |
### Set diff-cmd to the absolute path of your 'diff' program. | |
### This will override the compile-time default, which is to use | |
### Subversion's internal diff implementation. | |
-# diff-cmd = diff_program (diff, gdiff, etc.) | |
+diff-cmd = colordiff | |
### Set diff3-cmd to the absolute path of your 'diff3' program. | |
### This will override the compile-time default, which is to use | |
### Subversion's internal diff3 implementation. |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> | |
<script class="jsbin" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js" type="text/javascript"></script> | |
<script src="jquery.validate.cpf.js"></script> | |
<script type="text/javascript"> | |
$(function () { | |
var $cpf = $("#id_cpf").attr("name"); | |
var $params = {debug:false, rules:{}, messages:{}}; |
/* Media queries used on blog.staydecent.ca by Adrian Unger | |
check my full source at: | |
http://blog.staydecent.ca/static/css/style-0.1.6.css */ | |
@media only screen and (min-width:768px) and (max-width:1269px) { | |
/* In my particular design, I used a fluid grid limited to a | |
max-width of 1140px, while (if there is enough room) | |
pushing the menu outside of layout, requiring a total | |
limit of at least 1270px. | |
So, this first query applies to any screen-width less |
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers | |
Africa/Asmara | |
Africa/Asmera | |
Africa/Bamako | |
Africa/Bangui | |
Africa/Banjul | |
Africa/Bissau |
// using jQuery library and validation plugin in this code | |
// for checking keycodes | |
function getKeyCode(event) { | |
var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode)); | |
return keycode; | |
} | |
// is there an anchor as Submit button? | |
var $submit = $('a[id$="_submit"]'); | |
// is there any behavior already on submit, like -> onclick="__doPostBack(...)" |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
/* | |
Distributed under The MIT License: | |
http://opensource.org/licenses/mit-license.php | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to |
# If you're getting this error trying to use ApacheBench on OS X Lion: | |
# Benchmarking mwmanning.com (be patient)...apr_socket_recv: Connection reset by peer (54) | |
# | |
# You need to download the latest beta version of Apache and rebuild ab. | |
# Here's how (assuming you have homebrew installed). | |
# Install Homebrew (https://github.com/mxcl/homebrew) and then the Perl Regex support | |
brew install pcre | |
# Download the latest from http://httpd.apache.org/download.cgi, then decompress and compile it |