Skip to content

Instantly share code, notes, and snippets.

View arielallon's full-sized avatar
🙊

Ariel Allon arielallon

🙊
View GitHub Profile
@arielallon
arielallon / redis-delete-by-patter.lua
Created December 2, 2014 17:49
Redis DEL keys matching pattern
EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 prefix:*
@arielallon
arielallon / jpg-to-pdf.sh
Created February 24, 2015 04:11
Convert a bunch of jpgs to a paged pdf with the filenames watermarked on
convert *.jpg -gravity north -pointsize 15 -fill white -annotate 0 "%f" output.pdf
http://stackoverflow.com/a/25903802/1200542
@arielallon
arielallon / feedly.opml
Last active August 29, 2015 14:18
Ariel's Feedly
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Ariel subscriptions in feedly Cloud</title>
</head>
<body>
<outline text="science-y" title="science-y">
<outline type="rss" text="FiveThirtyEightFiveThirtyEight | Fe..." title="FiveThirtyEightFiveThirtyEight | Fe..." xmlUrl="http://fivethirtyeight.com/features/feed/" htmlUrl="http://fivethirtyeight.com"/>
<outline type="rss" text="Nautilus" title="Nautilus" xmlUrl="http://nautil.us/rss/all" htmlUrl="http://nautil.us/rss/all"/>
@arielallon
arielallon / create-local-branches.sh
Created July 29, 2015 15:22
Migrate branches and tags to git from svn when using Atlassian's scripts
for branch in `git branch -r | grep "origin/[^tags|master|trunk]" | sed 's/ origin\///'`; do
git branch $branch remotes/origin/$branch
done
from scapy.all import *
import requests
import time
MAGIC_FORM_URL = 'http://put-your-url-here'
def record_poop():
data = {
"Timestamp": time.strftime("%Y-%m-%d %H:%M"),
"Measurement": 'Poopy Diaper'
}
<?php
function wasteMemory($redis, $runs, $multi=false, $echoEvery=10000) {
if ($multi) {
$redis->multi();
}
for ($i=0; $i <= $runs; $i++) {
$redis->set('key'.$i, 'value'.$i);
if ($i % $echoEvery === 0) {
echo memory_get_peak_usage();
echo "\n";
@arielallon
arielallon / falseytest.php
Created December 5, 2017 17:08
Loose comparison of falsey types
<?php
$falsey = [
0,
'',
'0',
null,
false,
[],
];
@arielallon
arielallon / ya-print.css
Created April 24, 2020 21:41
Yediot Ahronot Print css
#ya-topdate {
display:none;
}
#ya-header-logo {
display:none;
}
.ExternalWebpageIframeResp {
display:none;