This file contains 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
(ns com.freiheit.clojure.appengine.appengine-local | |
(:use | |
[compojure.http routes servlet helpers] | |
clojure.contrib.test-is | |
compojure.server.jetty | |
[clojure.contrib def str-utils duck-streams]) | |
(:require | |
[clojure.contrib.logging :as log]) | |
(:import | |
[com.google.appengine.api.labs.taskqueue.dev LocalTaskQueue] |
This file contains 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 normalizeData2(data, intoArray) { | |
for(var key in data) { | |
var value = data[key]; | |
if (typeof(value) === 'object') { | |
normalizeData2(value, intoArray); | |
} else { | |
pair = [key, value]; | |
intoArray.push(pair); | |
} |
This file contains 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 xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css" type="text/css" /> | |
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAUXDSXET8IRGdgHP9FpGw5BT-fVzUWGS_eJ2ZLPBO_6yPqTi0vhQKAzahOrduDq0xQk09GR-UP3Jgcg'></script> | |
<script src="http://openlayers.org/api/OpenLayers.js"></script> | |
<script src="http://www.google.com/jsapi?key=ABQIAAAAUXDSXET8IRGdgHP9FpGw5BT-fVzUWGS_eJ2ZLPBO_6yPqTi0vhQKAzahOrduDq0xQk09GR-UP3Jgcg"></script> | |
<script type="text/javascript"> | |
google.load("jquery", '1.4'); | |
google.load("maps", "2.x"); | |
</script> |
This file contains 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() { | |
//run the accordion plugin, set height of sections to height of content | |
$("#accordion").accordion({ autoHeight: false }); | |
}); | |
;(function($) { | |
//write new sammy application | |
var app = new Sammy.Application(function() { | |
with(this) { | |
//corresponds to routes such as #/section/1 | |
get('#/section/:section_id', function() { with(this) { |
This file contains 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
//get first part of current url, without hash | |
var base_path = window.location.href.split("#")[0]; | |
var real_id = 0; | |
var current_page; | |
;(function($) { | |
//create new sammy app | |
var app = new Sammy.Application(function() { | |
with(this) { | |
//corresponds to routes like #/slide/1 | |
get('#/slide/:page_id', function() { with(this) { |
This file contains 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
!default_rounded_amount ||= 5px | |
// Round corner at position by amount. | |
// values for position: "top-left", "top-right", "bottom-left", "bottom-right" | |
=round-corner(!position, !amount = !default_rounded_amount) | |
border-#{!position}-radius= !amount | |
-moz-border-#{!position}-radius= !amount | |
-webkit-border-#{!position}-radius= !amount | |
// Round left corners by amount |
This file contains 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
#http://blog.wyeworks.com/2009/7/13/paperclip-file-rename | |
Paperclip.interpolates :default_image_type do |attachment, style| | |
attachment.instance.get_user_default_profile_image | |
end | |
Paperclip.interpolates :normalized_avatar_file_name do |attachment, style| | |
attachment.instance.normalized_avatar_file_name | |
end | |
This file contains 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
## PayRoll Application Gem | |
# lib/pay_roll/pay_day_service.rb | |
# Consider this Use Case as the Context in DCI | |
# | |
class PayRoll::PayDayService | |
def initialize(date=Date.today) | |
@date = date | |
# Employee could be any data source from the host, |
This file contains 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
import opencv | |
#this is important for capturing/displaying images | |
from opencv import highgui | |
import pygame | |
import sys | |
camera = highgui.cvCreateCameraCapture(0) | |
def get_image(): | |
im = highgui.cvQueryFrame(camera) | |
# Add the line below if you need it (Ubuntu 8.04+) |
This file contains 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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="author" content="Victor Stan"> | |
<meta name="description" content="Get multiple video streams on one page. Adapted from code by Muaz Khan"> | |
<title>Video Camera</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js" ></script> |
OlderNewer