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>Side Scroller</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> | |
<style type="text/css"> | |
#posts {position: relative; width: 300px;} | |
.controls {position: relative; height: 2em; width: 100%;} | |
.controls .control {position: absolute; top: 0px; cursor: pointer;} | |
#post_controls #left {left: 0px;} | |
#post_controls #right {right: 0px;} |
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
/* Array Monkey Patching */ | |
Array.prototype.includes = function(value) { | |
var length = this.length; | |
for(var i=0; i < length; i++) { | |
if(this[i] == value) { return true; } | |
} | |
return false; | |
} |
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
javascript:Ai7Mg6P=''; | |
var images=document.getElementsByTagName('img'); | |
if(images.length>=1){ | |
var images_string=''; | |
for(i7M1bQz=0;i7M1bQz<images.length;i7M1bQz++){ | |
var image_src=images[i7M1bQz].src; | |
images_string+=('<img style=\'pointer:cursor;\' src=\''+image_src+'\' onClick="location.href=\'http://user.adme.in/blog/add?username=username&access=access_id&img='+image_src+'&title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href)+'\'" />'); | |
} | |
document.write('<center><h2>Click on an image to post it on your wall</h2><br /><div id=\'photoblog-images\'>'+images_string+'</div></center>'); | |
}else{alert('There are no images on this page. Please find the image you would like and try again.');} |
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
# -- git parsed prompt -- | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
PS1="${debian_chroot:+($debian_chroot)}\[\033[0;34m\]\u@\h\[\033[00m\]:\[\033[0;36m\]\W\[\033[00m\]\$(parse_git_branch) $" | |
# -- # |
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
SELECT `properties`.* FROM `properties` WHERE ( | |
(ACOS(least(1,COS(0.581302161922681)*COS(-1.95199805553677)*COS(RADIANS(properties.lat))*COS(RADIANS(properties.lng))+ | |
COS(0.581302161922681)*SIN(-1.95199805553677)*COS(RADIANS(properties.lat))*SIN(RADIANS(properties.lng))+ | |
SIN(0.581302161922681)*SIN(RADIANS(properties.lat))))*3963.19) | |
) LIMIT 0, 10 |
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
$(document).ready(function() { | |
$('#report_upload').uploadify({ | |
'uploader' : '/uploadify.swf', | |
'script': '<%= url_for(:action => :create) %>', | |
'cancelImg' : '/images/cancel.png', | |
'auto' : false, | |
'fileDataName' : 'report[upload]', | |
'onComplete' : function() {window.location = "<%= users_path %>"}, | |
'scriptData' : { | |
'report[upload_type]' : function() {$('#report_upload_type').val()}(), |
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 ask_name | |
@name = "" | |
puts "What is your first name?" | |
@name = gets.chomp | |
puts "And you middle name?" | |
@name += " #{gets.chomp}" | |
puts "And finally, what is your last name?" | |
@name += " #{gets.chomp}" | |
puts "So your full name is #{@name}? (y/n)" |
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
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
COLOR_NONE="\[\e[0m\]" | |
LIGHT_BLUE="\[\033[0;36m\]" |
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
scope :with_name, lambda { |name| | |
case self.configurations[Rails.env]['adapter'] | |
when 'mysql' | |
where("name LIKE '%#{name}%'") | |
when 'postgresql' | |
where("lower(name) LIKE '%#{name.downcase}%'") | |
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 pending_memberships | |
memberships.select {|membership| membership if membership.status == 'pending'} | |
end |