Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Plugaru xarg

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am xarg on github.
  • I am xarg (https://keybase.io/xarg) on keybase.
  • I have a public key ASBdN39el6YVZcbsgWyDLAW6PyZQycWoIrv38VR-YQ0otQo

To claim this, I am signing this object:

View gist:d7c89e7db0629bd4ecd06bf23962db88
<script src="https://gorgias-assets.global.ssl.fastly.net/static/public/js/gorgias-chat.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
GorgiasChat.init({
"icon": "https://gorgias-uploads.global.ssl.fastly.net/Sans%20titre-1-3ac0278e-fc92-4ec5-8c22-d842c86dcc4a.png",
"headerColor": "#eb144c",
"chatIconColor": "#eb144c",
"conversationColor": "#0693e3",
"smooch": {
"appToken": "8z8htxf16diglhv7kb6sowq74",
@xarg
xarg / rabbitmq.dockerfile
Created Feb 27, 2016
Rabbitmq Dockerfile
View rabbitmq.dockerfile
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND noninteractive
RUN echo 'APT::Install-Recommends "0"; \n\
APT::Get::Assume-Yes "true"; \n\
APT::Get::force-yes "true"; \n\
APT::Install-Suggests "0";' > /etc/apt/apt.conf.d/01buildconfig
# Add files.
COPY ./bin/rabbitmq.sh /usr/local/bin/
@xarg
xarg / rabbitmq.dockerfile
Created Feb 27, 2016
Rabbitmq Dockerfile
View rabbitmq.dockerfile
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND noninteractive
RUN echo 'APT::Install-Recommends "0"; \n\
APT::Get::Assume-Yes "true"; \n\
APT::Get::force-yes "true"; \n\
APT::Install-Suggests "0";' > /etc/apt/apt.conf.d/01buildconfig
# Add files.
COPY ./bin/rabbitmq.sh /usr/local/bin/
@xarg
xarg / gist:3b33e5c937e663b511a3
Last active Aug 29, 2015 — forked from miohtama/gist:5389146
Parse email body and get only the text
View gist:3b33e5c937e663b511a3
import email
def get_decoded_email_body(message_body):
""" Decode email body.
Detect character set if the header is not set.
We try to get text/plain, but if there is not one then fallback to text/html.
:param message_body: Raw 7-bit message body input e.g. from imaplib. Double encoded in quoted-printable and latin-1
@xarg
xarg / websql2json
Created Mar 3, 2015
WebSQL to jSON dump
View websql2json
//change table variables below according to your case and you should get a nice JSON at the end
var db = "db";
var table = "your_table";
var db = openDatabase(db, '1.0.0', '', 2 * 1024 * 1024);
db.transaction(function (tx) {
var l = [];
tx.executeSql('select * from ' + table, null, function(tx, res){
for (var i = 0; i < res.rows.length; i++) {
l.push(res.rows.item(i));
}
View benchmark.sh
#!/bin/bash
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..."
echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n"
## Gnuplot settings
echo "# Let's output to a jpeg file
set terminal jpeg size 1280,720
# This sets the aspect ratio of the graph
View gist:10017372
brew install autoconf automake brew-cask freetype gdbm gettext git-sh gnu-getopt gnupg2 gpg-agent gradle imagemagick jpeg lame libassuan libevent libgcrypt libgpg-error libksba libpng libtool libusb libusb-compat mad memtester node openssl ossp-uuid pass pcre pinentry pkg-config postgresql pth pwgen python readline sox sqlite the_silver_searcher tmux tree
brew cask install f-lux google-drive libreoffice pgadmin3 seashore spectacle webstorm android-file-transfer firefox gimp iterm2 macvim pycharm clipmenu font-dejavu google-chrome keyremap4macbook menumeters rdio sketch unrarx
@xarg
xarg / fix_capsulecrm_addresses.py
Last active Dec 18, 2015
Fix Capsule CRM addresses using Google Geocoding API
View fix_capsulecrm_addresses.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Using google geocoding API try to fix addresses in capsule
"""
import sys
import argparse
import requests