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
function getParameterByName(name) | |
{ | |
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); | |
var regexS = "[\\?&]" + name + "=([^&#]*)"; | |
var regex = new RegExp(regexS); | |
var results = regex.exec(window.location.search); | |
if(results == null) | |
return ""; | |
else | |
return decodeURIComponent(results[1].replace(/\+/g, " ")); |
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
(function(url){ var iframe = document.createElement('iframe'); (iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0"; var where = document.getElementsByTagName('script'); where = where[where.length - 1]; where.parentNode.insertBefore(iframe, where); var doc = iframe.contentWindow.document; doc.open().write('<body onload="'+ 'var js = document.createElement(\'script\');'+ 'js.src = \''+ url +'\';'+ 'document.body.appendChild(js);">'); doc.close(); })('http://www.jspatterns.com/files/meebo/asyncjs1.php'); |
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
Name Character Entity | |
Copyright © © | |
Registered ® ® | |
Trademark ™ ™ | |
Curly Open Double Quote “ “ | |
Curly Closed Double Quote ” ” | |
Curly Open Single Quote ‘ ‘ | |
Curly Closed Single Quote ’ ’ | |
Big Bullet/Dot • • | |
Small Bullet/Dot · · |
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
Here's what I think it should include: | |
name of the projects and all sub-modules and libraries (sometimes they are named different and very confusing to new users) | |
descriptions of all the project, and all sub-modules and libraries | |
5-line code snippet on how its used (if it's a library) | |
copyright and licensing information (or "Read LICENSE") | |
instruction to grab the documentation | |
instructions to install, configure, and to run the programs | |
instruction to grab the latest code and detailed instructions to build it (or quick overview and "Read INSTALL") | |
list of authors or "Read AUTHORS" |
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
message = message.gsub(/[^0-9a-z]/i, '') |
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
This article originally appeared in Details Magazine some time around 1994 or 1995, I believe. This is a great essay by Henry Rollins on the benefits and lessons of lifting weights. | |
================================================= | |
I believe that the definition of definition is reinvention. To not be like your parents. To not be like your friends. To be yourself. | |
Completely. | |
When I was young I had no sense of myself. All I was, was a product of all the fear and humiliation I suffered. Fear of my parents. The humiliation of teachers calling me "garbage can" and telling me I'd be mowing lawns for a living. And the very real terror of my fellow students. I was threatened and beaten up for the color of my skin and my size. I was skinny and clumsy, and when others would tease me I didn't run home crying, wondering why. |
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
ssh me@myserver | |
cd repository.git | |
sudo chmod -R g+ws * | |
sudo chgrp -R mygroup * | |
git repo-config core.sharedRepository true |
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
module AsyncHelper | |
def javascript_async(*args) | |
content_tag :script, type: "text/javascript" do | |
"(function() { | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.async = true; | |
script.src = '#{j javascript_path(*args)}'; | |
var other = document.getElementsByTagName('script')[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
namespace :db do | |
desc "Handle orphans" | |
task :handle_orphans => :environment do | |
Dir[Rails.root + "app/models/**/*.rb"].each do |path| | |
require path | |
end | |
ActiveRecord::Base.send(:descendants).each do |model| | |
model.reflections.each do |association_name, reflection| | |
if reflection.macro == :belongs_to | |
model.all.each do |model_instance| |
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
class Controller | |
include LazyLoad | |
def show | |
@model = Model.find(...) | |
respond_to do |format| | |
format.html do | |
@html_specific_data = Model.find(...) | |
end |