Skip to content

Instantly share code, notes, and snippets.

@Meettya
Meettya / image_loader.jade
Created May 16, 2013 18:22
Just naive cached image loader in coffee with jade
extends includes/layout
block content
:coffeescript
images_srcs = [
'http://st.gdefon.ru/wallpapers_original/wallpapers/241906_kotenok_mordochka_trava_pushistyj_1920x1200_(www.GdeFon.ru).jpg'
'http://www.allfons.ru/pic/201112/1920x1080/allfons.ru-967.jpg'
'http://st.gdefon.ru/wallpapers_original/wallpapers/155879_kotyonok_vzglyad_kotye_1920x1200_(www.GdeFon.ru).jpg'
'http://st.gdefon.ru/wallpapers_original/wallpapers/17769_kotenok_ryzhij_pushistyj_fortepiano_1280x1024.jpg'
'http://catfoto.com/uploads/images/00/00/18/2011/02/12/7999cc.jpg'
@Meettya
Meettya / gist:5416608
Created April 18, 2013 22:03
Raphael moveable&resizable rectangle with active cocners, proto
doctype html
html
head
meta(charset='utf-8', http-equiv='X-UA-Compatible', content='IE=edge,chrome=1')
title Project name
link(rel='stylesheet', href = 'css/style.css')
script(src='vendor/mock.js')
[user]
name =
email =
[core]
autocrlf = input
safecrlf = true
whitespace = fix, -indent-with-non-tab, trailing-space, cr-at-eol
pager = less -R
@Meettya
Meettya / gist:3368422
Created August 16, 2012 08:32
ffmpeg command to save still images from video
# 1) to save all frames from (-i INPUT_VIDEO) input video file,
# (-ss 00:10:00) started at 10 minute and (-t 10) stop after 10 seconds,
# (-same_quant) use same quantizer as source (-f image2) with image2 muxer and
# (img-%04d.jpg) img-0001.jpg pattern
#
# - you get bunch of files
ffmpeg -i INPUT_VIDEO -ss 00:10:00 -t 10 -same_quant -f image2 img-%04d.jpg
# 2) to save (-r 6) 6 frames in second
TravelMate:bin meettya$ ./ab -n 10000 -c 480 -k http://192.168.1.2:3000/?url=$RANDOM
This is ApacheBench, Version 2.3 <$Revision: 1178079 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.1.2 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
@Meettya
Meettya / gist:3082964
Created July 10, 2012 12:22 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@Meettya
Meettya / org.chameleon.Boot.plist
Created June 15, 2012 11:22
/Extra files for 10.7.4 on TravelMate 4230
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GraphicsEnabler</key>
<string>Yes</string>
<key>Kernel Flags</key>
<string>arch=i386</string>
<key>DSDT</key>
<string>hd(0,1)/Extra/DSDT.aml</string>
@Meettya
Meettya / gist:2652928
Created May 10, 2012 13:18
Internal method for object merge, adopted form obj.merge from Sugar.js
###
Internal method for object merge, adopted form obj.merge from Sugar.js
###
_merge: (target, source, deep, resolve) ->
###
Some checking at start, we are dont need merge void objects at all
###
unless target? and source?
throw new Error """
@Meettya
Meettya / gist:2652639
Created May 10, 2012 12:11
why sugar is so sweet
# underscore.js
target[key] = if _.isArray val then [] else {}
# sugar.js
target[key] = if val?.isArray then [] else {}
@Meettya
Meettya / gist:2342550
Created April 9, 2012 09:40
Object Method
/*
Public method to get all settings at once
*/
Configurator.prototype.get_all = function() {
return this._settings;
};