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
#!/usr/bin/env node | |
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs"), | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { |
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
#!/bin/bash | |
COUCH_DB="http://127.0.0.1:5984/what_ever" | |
JSON_FOLDER="./jsonFiles/*" | |
TMP_FILE="/tmp/_couchdb_import.json" | |
for file in $JSON_FOLDER | |
do | |
echo '{"docs":' > $TMP_FILE | |
cat $file >> $TMP_FILE |
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
Album | |
Amateurmannschaft | |
Anwendungsseite | |
Arzneimittel | |
Attraktionen/Unternehmungen | |
Ausbildung | |
Ausflüge/Sehenswürdigkeiten | |
Automobil | |
Autor | |
Autos |
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
def fb_batch_request(id_array, access_token) | |
raise "Array to long (>20)" if id_array.length > 20 | |
queries = id_array.map { |id| {:method => 'GET', :relative_url => "#{id}"} } | |
route = "https://graph.facebook.com/?access_token=#{access_token}&batch=#{URI.encode(queries.to_json)}" | |
HTTParty.post(route) | |
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
# Track clicks with Google Analytics and Mixpanel | |
# | |
# == How to use == | |
# Links that have the "data-track_event" attribute set will be tracked when clicked. | |
# | |
# == How it works == | |
# The to-be-tracked events are stored in a cookie and sends to the Google Analytics and Mixpanel | |
# with the next page requests. | |
# | |
# |
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
<!-- Navbar | |
================================================== --> | |
<div class="navbar navbar-inverse navbar-fixed-top" id="bs_top-menu"> | |
<div class="navbar-inner"> | |
<div class="container"> | |
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</button> |
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
################################################################## | |
# # | |
# Copyright (C) 2012 Dommmel <dommmel@gmail.com> # | |
# This code is released under WTFPL, version 2.0. # | |
# # | |
################################################################## | |
# Usage: | |
# <span id="sayhi">привет</span> | |
# <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
#! /usr/bin/env ruby | |
require 'fileutils' | |
require 'erb' | |
require 'RMagick' | |
include Magick | |
template = ERB.new <<-EOF | |
<!DOCTYPE html> | |
<html> |
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 casper = require('casper').create({ | |
viewportSize: {width: 950, height: 950} | |
}); | |
casper.start('http://www.google.com/', function() { | |
this.captureSelector('/tmp/pp.png', 'body'); | |
}); | |
casper.run(); |
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
require 'rufus/scheduler' | |
scheduler = Rufus::Scheduler.start_new | |
if Rails.env.production? | |
scheduler.every '10m' do | |
require "net/http" | |
require "uri" | |
Net::HTTP.get_response(URI.parse(ENV["HOSTNAME"])) | |
end | |
end |
OlderNewer