Skip to content

Instantly share code, notes, and snippets.

View mk0x9's full-sized avatar

Mikhail Kuryshev mk0x9

  • Berlin, Germany
  • 20:23 (UTC +02:00)
View GitHub Profile
$ ruby test_server.rb -e production -p 9000 -d
$ ab -n 5000 -c 1000 http://localhost:9000/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 500 requests
Completed 1000 requests
# http://stackoverflow.com/questions/9739654/rake-assetsprecompile-taking-extremely-long-to-complete
# nocompress
module Sass
module Rails
class CssCompressor
def compress(css)
css
end
end
$ qmake-qt4 -spec linux-g++-32 && make
/usr/lib64/qt4/bin/uic aboutdialog.ui -o ui_aboutdialog.h
/usr/lib64/qt4/bin/uic settingsdialog.ui -o ui_settingsdialog.h
g++ -c -m32 -pipe -std=c++0x -O2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -D_REENTRANT -fPIC -DSKYPETABNG_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++-32 -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -o mainwindow.o mainwindow.cpp
g++ -c -m32 -pipe -std=c++0x -O2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -D_REENTRANT -fPIC -DSKYPETABNG_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++-32 -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -o x11int.o x11int.cpp
g++ -c -m32 -pipe -std=c++0x -O2 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buf
@mk0x9
mk0x9 / icfpc2012.ls
Created August 1, 2012 22:01
ICFPC 2012 submission
time_start = process.hrtime!
String::replaceAt = (idx, c) ->
@substr(0, idx) + c + @substr(idx + c.length)
PF = require \pathfinding
fs = require \fs
read-map = ->
arr = fs.readFileSync it, \ascii |> (.split \\n)
idx = 0
body_click_handler = ->
(jQuery 'body').click (e) ->
switch e.target.getAttribute 'data-action'
require 'ffi'
class ASS_Event < FFI::Struct
layout :start, :long_long,
:duration, :long_long,
:readOrder, :int,
:layer, :int,
:style, :int,
:name, :string,
:marginL, :int,
$ cat /usr/share/calendar/calendar.lotr
/*
* Lord Of The Rings
*
* $FreeBSD: src/usr.bin/calendar/calendars/calendar.lotr,v 1.2 2003/10/09 00:31:48 grog Exp $
*/
#ifndef _calendar_lotr_
#define _calendar_lotr_
<!doctype html>
<html>
<head>
<title>test</title>
<link rel='stylesheet' href='http://localhost:8088/assets/test.css'>
</head>
<body>
<div id='container'>
<div id='inner'>
<div id='spacer-before' class='spacer'></div>
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwVACPi9w23mF3tBkdZz+
zwrzKOaaQdr01vAbU4E1pvkfj4sqDsm6lyDONS789sVoD/xCS9Y0hkkC3gtL1tSf
TlgCMOOul9lcixlEKzwKENj1Yz/s7daSan9tqw3bfUV/nqgbhGX81v/+7RFAEd+R
wFnK7a+XYl9sluzHRyVVaTTveB2GazTwEfzk2DWgkBluml8OREmvfraX3bkHZJTK
X4EQSjBbbdJ2ZXIsRrYOXfaA+xayEGB+8hdlLmAjbCVfaigxX0CDqWeR1yFL9kwd
9P0NsZRPsmoqVwMbMu7mStFai6aIhc3nSlv8kg9qv1m6XHVQY3PnEw+QQtqSIXkl
HwIDAQAB
-----END PUBLIC KEY-----
<!doctype html>
<html>
<head>
<title></title>
</head>
<body>
<script>
(function () {
if(/mobile/i.test(navigator.userAgent)) {
document.body.className += ' mobile';