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 "compass/utilities/sprites/base"; | |
$toolbar-icon-sprites: sprite-map("icons/toolbar_*.png"); | |
$sidebar-icon-sprites: sprite-map("icons/sidebar_*.png"); | |
.toolbar-icon { background: $toolbar-icon-sprites; } | |
.sidebar-icon { background: $sidebar-icon-sprites; } | |
#toolbar { |
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
module Noodall | |
module Search | |
STOPWORDS = ["about", "above", "above", "across", "after", "afterwards", "again", "against", "all", "almost", "alone", "along", "already", "also", "although", "always", "among", "amongst", "amoungst", "amount", "and", "another", "any", "anyhow", "anyone", "anything", "anyway", "anywhere", "are", "around", "back", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "bill", "both", "bottom", "but", "call", "can", "cannot", "cant", "con", "could", "couldnt", "cry", "describe", "detail", "done", "down", "due", "during", "each", "eight", "either", "eleven", "else", "elsewhere", "empty", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few", "fifteen", "fify", "fill", "find", "fire", "first", "five", "for", "former", "formerly", "forty", "found", "four", "from", "front", "full", "further", "get", "give", "had", "has", "hasnt", "have", |
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
# Usage: show <local-port> <subdomain> | |
function show() { | |
DOMAIN=".tekacs.com" | |
REMOTE="$2$DOMAIN" | |
ssh -tR 1080:127.0.0.1:$1 vps "sudo ssh -Nl \$USER -L $REMOTE:80:127.0.0.1:1080 localhost" | |
} |
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
// | |
// Given an array of N (can be very large) 64 bit integers where every integer 1-N | |
// appears once in the array, except there is one integer missing and one integer | |
// duplicated, find the missing and duplicated integers. The algorithm should run | |
// in linear time and in small constant space and leave the array untouched. | |
// | |
static void GetDuplicateAndMissing(long[] a, out long duplicate, out long missing) | |
{ | |
long xor = 0; // duplicate ^ missing |
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
# app/uploaders/avatar_uploader.rb | |
process :fix_exif_rotation | |
process :strip | |
process :resize_to_fill => [1024, 768] | |
process :quality => 90 # Percentage from 0 - 100 |
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
# Reversed or “Real Time” Search in ElasticSearch | |
# ==================================================================================== | |
# You may have come across the term “realtime search” lately | |
# (eg. [here](http://engineering.socialcast.com/2011/05/realtime-search-solr-vs-elasticsearch/)) | |
# and wondered what all the fuss is about. | |
# | |
# Well, the usual workflow with search engines goes like this: | |
# | |
# 1. You index some documents. |
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
// Config | |
{ | |
"index" : { | |
"analysis" : { | |
"filter" : { | |
"my_ngram" : { | |
"max_gram" : 20, | |
"min_gram" : 2, | |
"type" : "nGram" | |
} |
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
var MoogPlus = new Class({ | |
Extends: Fx.Morph, | |
options: { | |
rowSelector: '.row', | |
activeClass: 'active', | |
event: 'click', | |
'class': 'MoogPlus', |
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
argv = process.argv.slice(2) | |
stitch = require('stitch') | |
fs = require('fs') | |
mode = argv[0] || "DEV" | |
package = stitch.createPackage | |
paths: [__dirname + '/scripts'] | |
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
<?php | |
//... Product class code ... | |
public function addTags(\Khepin\ProductBundle\Entity\Tag $tags) | |
{ | |
$this->tags[] = $tags; | |
$tags->setProduct($this); | |
} |