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
sub censor | |
{ | |
my ($msg, $stopwords_regex) = @_; | |
my $letters = { map { $_ => 1 } ( 'a' .. 'z', 'A' .. 'Z', '0' .. '9', '@' ) }; | |
$msg =~ s/ / /og; | |
my $i = 0; | |
my $numerated_letters = [ grep { $letters->{$_->[1]} } map { [ $i++ , $_ ] } split //, $msg_cp ]; | |
my $deobfuscated_msg = join( '', map { $_->[1] } @$numerated_letters ); |
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
## Rails App Template | |
## Updated for Rails 3.0.7 | |
## Created on 10/23/10 | |
## Updated on 5/25/11 to simplify for my own use | |
## Run using $ rails new [appname] -JT -m tpl-basicapp.rb | |
## Gems | |
# Warden and Devise for security | |
gem 'warden', '1.0.4' |
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
%% show comment | |
handle(HD, {get, {comments, CommentId}}, Req) when is_integer(CommentId) -> | |
Result = case select_comment(person, CommentId) of | |
not_found -> | |
error_404; | |
Comment -> | |
UserId = proplists:get_value(user_id, Comment), | |
[Uinfo|_] = select_uinfoes_by_ids(person, [UserId]), | |
{ok, {[ | |
{comment, {Comment} }, |
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
module SocialConnect | |
module Providers | |
class Vkontakte < Base | |
config_readers :app_id, :app_secret | |
config_readers :group_id | |
js_config :app_id, :group_id | |
cookie_key do | |
"vk_app_#{app_id}" |
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/sh | |
# Dependencies: | |
# sudo apt-get install cuetools shntool | |
SAVEIFS=$IFS | |
IFS='\n' | |
find ./ -name '*.flac' -size +100M | while read image | |
do | |
echo "$image" |
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
тест oEmbed http://www.oembed.com/ | |
Напишите мне, пожалуйста, если видите это в своем клиенте. |
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/sh | |
REF=`git symbolic-ref HEAD | sed -e 's/refs\/heads\///'` | |
REMOTE=`git config --get branch.$REF.remote` | |
git fetch $REMOTE | |
git push -f $REMOTE $REF |
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
this.Twitter = function(opts) { this.init(opts); }; | |
this.Twitter.prototype = { | |
init: function(opts) { | |
var self = this; | |
self.opts = opts; | |
if (!self.opts.container) self.opts.container = default_container(); |
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
screen pair programming | |
User john (driver): | |
echo "multiuser on" >> ~/.screenrc | |
sudo chmod u+s /usr/bin/screen | |
sudo chmod 755 /var/run/screen | |
screen -S pairprog |
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 A = function(){ | |
console.debug("A constructor"); | |
A.build(); | |
}; | |
(function(){ | |
var p = 0; | |
this.B = function(){ | |
console.debug('B constructor'); | |
}; |