Skip to content

Instantly share code, notes, and snippets.

@gailimov
gailimov / gist:1362347
Created November 13, 2011 17:12
Pretty awesome parser of advices from http://fucking-great-advice.ru
# coding: utf-8
# Pretty awesome parser of advices from http://fucking-great-advice.ru
# PHP version from Dmitry Zudochkin: https://gist.github.com/1303241
# Author: Kanat Gailimov <gailimov@gmail.com> (http://gailimov.info) with love :)
require 'json'
require 'open-uri'
require 'cgi'
@barrynewman
barrynewman / redis_json_marshal_eval_benchmarks.rb
Created April 23, 2012 21:06 — forked from shilov/redis_json_marshal_eval_benchmarks.rb
Ruby Redis benchmarks for JSON vs Marshal vs String
# http://forrst.com/posts/JSON_vs_Marshal_vs_eval_Which_is_the_fastest_fo-6Qy
require 'benchmark'
require 'json'
require 'redis'
# -----------------
puts "Initialize variables.."
@amontalenti
amontalenti / Storm-Topology-Freeze-Issues.md
Last active December 8, 2017 07:17
Storm 0.9.2 exceptions related to multiple workers/supervisors

Conditions

Two Storm supervisors running in a 3-node configuration: one "head" node (nimbus) and two worker nodes. Each supervisor node runs a supervisor under supervision.

Topology

Multi-lang topology using Python and our streamparse library. Works fine when running on a single machine. Spout reads off Kafka and inserts tuples into

@ZhiguoLong
ZhiguoLong / i3exit.sh
Created February 14, 2016 06:55
i3 helper shell command for exiting
#!/bin/sh
lock() {
exec sh ~/.i3/i3lock.sh
}
case "$1" in
lock)
lock
;;
logout)
@kaito834
kaito834 / curl_multipart-mixed_sample.bat
Created June 27, 2015 06:10
send a HTTP request which Content-Type is 'multipart/mixed' by cURL
@echo off
REM http://curl.haxx.se/docs/manpage.html#-F
REM http://curl.haxx.se/mail/archive-2010-03/0049.html
REM cURL installed with msysgit is used on this batch.
REM Output of "curl -V" is below
REM curl 7.41.0 (i386-pc-win32) libcurl/7.41.0 OpenSSL/0.9.8zf zlib/1.2.8
REM Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
REM Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz
set curlPath="C:\Program Files (x86)\Git\bin\curl.exe"
@dalegaspi
dalegaspi / python27_on_centos65.md
Last active September 9, 2021 05:29
Installing Python 2.7 on CentOS 6.5

Installing Python 2.7 on Centos 6.5

Centos 6.* comes with Python 2.6, but we can't just replace it with v2.7 because it's used by the OS internally (apparently) so you will need to install v2.7 (or 3.x, for that matter) along with it. Fortunately, CentOS made this quite painless with their Software Collections Repository

sudo yum update # update yum
sudo yum install centos-release-scl # install SCL 
sudo yum install python27 # install Python 2.7

To use it, you essentially spawn another shell (or script) while enabling the newer version of Python:

@damianmcdonald
damianmcdonald / JerseyRestClientMultipartUpload.java
Created July 19, 2015 11:16
Multi Part Upload using Jersey REST client
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;
import com.sun.jersey.core.header.FormDataContentDisposition;
import com.sun.jersey.multipart.FormDataMultiPart;
import com.sun.jersey.multipart.MultiPart;
import com.sun.jersey.multipart.file.FileDataBodyPart;
import org.json.JSONObject;
@mrflip
mrflip / tuning_storm_trident.asciidoc
Last active May 27, 2022 23:59
Notes on Storm+Trident tuning

Tuning Storm+Trident

Tuning a dataflow system is easy:

The First Rule of Dataflow Tuning:
* Ensure each stage is always ready to accept records, and
* Deliver each processed record promptly to its destination

Current status : working, but no fingerprint reader and no Fn key before first suspend.

Initial hardware setup

How I got it working

@bangedorrunt
bangedorrunt / article-style.css
Last active July 17, 2023 13:40
GoldenDict Dark Theme
body
{
margin-top: 1px;
margin-right: 3px;
margin-left: 2px;
margin-bottom: 3px;
background: #201F1F;
color: white;
font-family: Bookerly, Segoe UI, Palatino Linotype, Arial Unicode MS;
}