Skip to content

Instantly share code, notes, and snippets.

@Altreus
Altreus / test.pl
Last active August 29, 2015 14:03 — forked from vaskozl/test.pl
#!/usr/bin/perl
use warnings;
use strict;
package MyBot;
use base qw( Bot::BasicBot );
# the 'said' callback gets called when someone says something in
# earshot of the bot.
sub said {
DELETE
sip
FROM
search_index_products sip
JOIN products p ON sip.productId=p.productId AND (sip.countryId=p.countryId OR (p.countryId=? AND p.productId NOT IN (SELECT productId FROM
products WHERE countryId=?)))
WHERE
p.refreshCache=1
AND sip.countryId=?
SELECT *
FROM products
WHERE productId IN (
SELECT relatedId
FROM product_suggestions
WHERE productId=?
)
AND live=1
AND archive=0
AND (
sub notes {
my ($pattern, @scale) = @_;
return map { $note < @scale ? $scale[$note] : undef } split //, $pattern;
}
#...
for my $note (notes($pattern, @scale)) {
if (defined $note) {
$ re.pl
$ use warnings; use 5.010;
$ (0 > undef) . "\n"
Use of uninitialized value in numeric gt (>) at (eval 309) line 5, <FIN> line 2.
$ (0 >= undef) . "\n"
Use of uninitialized value in numeric ge (>=) at (eval 310) line 5, <FIN> line 3.
1
$ (0 == undef) . "\n"
Use of uninitialized value in numeric eq (==) at (eval 311) line 5, <FIN> line 4.
#!/usr/bin/perl
use strict;
use warnings;
use Cwd;
use Data::Dumper; # yes really
use File::Basename;
use Daemon::Control;
use IO::Prompt::Tiny qw/prompt/;
$ PATH_INFO="/altre.us.git/HEAD" GIT_PROJECT_ROOT=/opt/git REQUEST_METHOD=GET /usr/lib/git-core/git-http-backend
Expires: Fri, 01 Jan 1980 00:00:00 GMT
Pragma: no-cache
Cache-Control: no-cache, max-age=0, must-revalidate
Content-Length: 23
Content-Type: text/plain
Last-Modified: Thu, 22 May 2014 12:23:33 +0000
ref: refs/heads/master
function delayedAddIcon(chart, flags) {
if ($('#topSubscribers .highcharts-container').length) {
addIcon(chart, flags);
}
else {
setTimeout(function() {
delayedAddIcon(chart, flags);
}, 100);
}
}
Rebase example!
===============
I forgot to commit some things remotely before I cloned my repo to work locally.
altreus@local:~ $ git clone altre.us:altre.us
Cloning into altre.us ...
<snip>
altreus@local:~/altre.us $ do_stuff
altreus@local:~/altre.us $ git commit -a -m"Turn off static cache for now"
@Altreus
Altreus / gist:9e02fe7bb9c2b7aa5d57
Created May 15, 2014 11:50
git knows when you're timing it
$ time git stash pop
On branch user-page
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: fuel/app/modules/management/views/user/list.php
Untracked files:
(use "git add <file>..." to include in what will be committed)