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 doSomething() { | |
open(location.href, 'refreshingWindow'); | |
} | |
(function loop() { | |
var rand = Math.round(Math.random() * (10000)) + 1000; | |
setTimeout(function() { | |
doSomething(); | |
loop(); | |
}, rand); |
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 'celluloid' | |
require "benchmark" | |
require 'open-uri' | |
delay_seconds = [4,4,4,4,4,4] | |
BASE_URL = "http://slowapi.com/delay" | |
class Crawler | |
include Celluloid | |
def read(delay) |
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
convert logo-solo.png -bordercolor white -border 0 \ | |
\( -clone 0 -resize 16x16 \) \ | |
\( -clone 0 -resize 32x32 \) \ | |
\( -clone 0 -resize 48x48 \) \ | |
\( -clone 0 -resize 64x64 \) \ | |
-delete 0 -transparent white -colors 256 favicon.ico |
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> | |
<html><head></head> | |
<!-- Standard Facebook Initialization --> | |
<body> | |
<div id="fb-root"></div> | |
<button>Loading...</button> | |
<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
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 |
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
#! /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
################################################################## | |
# # | |
# Copyright (C) 2012 Dommmel <[email protected]> # | |
# 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
<!-- 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
# 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. | |
# | |
# |