Skip to content

Instantly share code, notes, and snippets.

View allan-simon's full-sized avatar

Allan Simon allan-simon

View GitHub Profile
INFO global: Vagrant version: 2.2.4
INFO global: Ruby version: 2.4.4
INFO global: RubyGems version: 2.6.14.1
INFO global: VAGRANT_LOG="info"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.4/gems/va
b'Delivered-To: whatever@example.com\r\nReceived: by 2002:a9d:768e:0:0:0:0:0 with SMTP id j14csp5351006otl;\r\n Sun, 20 Jan 2019 09:51:56 -0800 (PST)\r\nX-Received: by 2002:a50:ad97:: with SMTP id a23mr22833147edd.128.1548006716467;\r\n Sun, 20 Jan 2019 09:51:56 -0800 (PST)\r\nARC-Seal: i=2; a=rsa-sha256; t=1548006716; cv=pass;\r\n d=google.com; s=arc-20160816;\r\n b=RBG0HsFKI3l8uGUu+nUCvAt1YLLN3lyJuwE92DJZO0XCzbwDfQ/oFJzIXLxh0L140Y\r\n 0PINopBd9R+raGyd8PzadibJqmFsLtVecTKDBWGzRLyWaw8ji7Whso6Age0htxC2HSmh\r\n FzOK4SFEejrhrSLNPRgcYzIDrbz1QOoe4iBtrx24cg6ZqD3bUAHo2F0qM56gkQ2AdHS0\r\n 2jJEpHMBENoo7aCPsSHDJsSeSSGlCko/G2R+AHqYbDvQqt0Fnee/wdjlpmoXUv8csErz\r\n fkLrrJd9cIrmVctFQC20XAYyy40/yHvpxaVzmzoBm6mGs6D1VNU+uprG0FHVfX7nIzT7\r\n N3DQ==\r\nARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;\r\n h=mime-version:spamdiagnosticmetadata:spamdiagnosticoutput\r\n :content-language:accept-language:messag
"""
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.
@allan-simon
allan-simon / pre-commit
Last active August 29, 2015 14:08
jshint pre-commit check
#!/bin/sh
files=$(git diff --cached --name-only --diff-filter=ACM | grep ".js$")
if [ "$files" = "" ]; then
exit 0
fi
pass=true
echo "\nValidating JavaScript:\n"
@allan-simon
allan-simon / lib.rs
Created July 26, 2014 17:56
Trying to compile this code with `rustc lib.rs` generate a internal compiler error with rust-nightly (4e7c5e5c)
#![crate_name = "xmpp"]
#![crate_type = "lib"]
pub fn handle() {
loop { }
println!("we close");
}
#include <string>
#include <iostream>
#include <SFML/Window.hpp>
int main() {
sf::Window application(
sf::VideoMode(800, 600),
"test"
import logging
from sleekxmpp import ClientXMPP
from sleekxmpp.exceptions import IqError, IqTimeout
JID = 'your_test_jid@example.com'
PASSWORD = "your_password"
ROOM_JID = "testroom@conference.example.com";
@allan-simon
allan-simon / gist:6972480
Created October 14, 2013 08:10
if you remove the `col` variable ,and add the buttonscatter directly like in https://gist.github.com/allan-simon/6972475 then it's going to take the full screen
import kivy
kivy.require('1.1.3')
import random
from kivy.lang import Builder
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
import kivy
kivy.require('1.1.3')
import random
from kivy.lang import Builder
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""FileChooserThumbView
====================
The FileChooserThumbView widget is similar to FileChooserIconView,
but if possible it shows a thumbnail instead of a normal icon.
Usage