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
/** | |
Docs: http://learn.javascript.ru/tutorial/lib | |
*/ | |
/** | |
* Анимация. Параметры: | |
* opts.delta(time) -- временная функция, time=0..1. По умолчанию linear. | |
* opts.step(progress) -- функция рисования, progress=0..1. | |
* opts.complete -- функция, которая выполнится по окончании анимации | |
* opts.delay -- задержка между кадрами, по умолчанию 13 |
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
/** | |
* For modern browsers | |
* 1. The space content is one way to avoid an Opera bug when the | |
* contenteditable attribute is included anywhere else in the document. | |
* Otherwise it causes space to appear at the top and bottom of elements | |
* that are clearfixed. | |
* 2. The use of `table` rather than `block` is only necessary if using | |
* `:before` to contain the top-margins of child elements. | |
*/ | |
.cf:before, |
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.prototype.method = function ( name, func ) { | |
this.prototype[name] = func; | |
return this; | |
}; | |
Function.method('inherits', function ( parent ) { | |
var depth = 0; | |
var proto = this.prototype = new parent(); |
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
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a | |
function! s:align() | |
let p = '^\s*|\s.*\s|\s*$' | |
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) | |
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) | |
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) | |
Tabularize/|/l1 | |
normal! 0 | |
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) |
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
arg = ARGV[0] | |
raise "Argument is not passed." unless arg | |
app = lambda do |env| | |
[200, {"Content-Type" => "text/plain"}, ["Command line argument you typed was: #{arg}"]] | |
end | |
puts app.call({}) |
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 "rack" | |
arg = ARGV[0] | |
raise "Argument is not passed." unless arg | |
app = lambda do |env| | |
[200, {"Content-Type" => "text/plain"}, ["Command line argument you typed was: #{arg}"]] | |
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
app = proc do |env| | |
res = Rack::Response.new | |
req = Rack::Request.new(env) | |
str = req.params['str'] | |
res.finish do |res| | |
res['Content-Type'] = 'text/plain' | |
res.status = 200 | |
res.write "Your string reversed is: #{str.reverse}" | |
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
#define _XOPEN_SOURCE | |
#include <ctype.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
int yell_args(int argc, char** argv); | |
short is_password(const char* plain, const char* salt, const char* cipher); | |
short dict_attack(const char* salt, const char* cipher); |
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
All of these resources were extremely valuable as I researched regex, finite state machines, and regex in Ruby. Check them out, they're full of fantastic information! | |
Articles | |
"Exploring Ruby's Regular Expression Algorithm" by Pat Shaughnessy | |
http://patshaughnessy.net/2012/4/3/exploring-rubys-regular-expression-algorithm | |
"Finite State Machines and Regular Expressions" by Eli Bendersky | |
http://www.gamedev.net/page/resources/_/technical/general-programming/finite-state-machines-and-regular-expressions-r3176 | |
"Regular Expression Matching Can Be Simple and Fast" by Russ Cox |
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
/*########################################################################################## | |
Prepend <span> in Flickr Widget | |
##########################################################################################*/ | |
jQuery(document).ready(function($){ | |
$('.ewd-banner-fixed').closest('.widget.widget_text').addClass('affix-banner'); | |
var addFixed = false; | |
$(window).scroll(function (e) { | |