Skip to content

Instantly share code, notes, and snippets.

@dipspb
dipspb / sencha-reverseAnimation-howto.js
Created April 12, 2011 08:41
How to produce reverse animation instance in SenchaTouch
function reverse(animation) {
var a = ('string' == typeof animation) ? Ext.anims[animation] : animation;
if (!a) return animation;
function BackAnimation(){}
BackAnimation.prototype = a;
var ba = new BackAnimation();
ba.config = Ext.apply({}, {reverse: true}, a.config);
return ba;
@dipspb
dipspb / x_domain_session_wrapper.rb
Created May 24, 2011 16:42
vendor/rhosync/lib/x_domain_session_wrapper.rb
require "cgi"
class XDomainSessionWrapper
def initialize(app, opts={})
@app = app
@session_cookie = opts[:session_cookie] || 'rhosync_session'
yield self if block_given?
end
def is_sync_protocol(env)
@dipspb
dipspb / build-log.txt
Created December 7, 2016 16:20
ArduPilot waf build failure inside of vagrant vm
Dmitriys-MBP:ardupilot dipspb$ vagrant up
.
.
.
Dmitriys-MBP:ardupilot dipspb$ vagrant rsync
Dmitriys-MBP:ardupilot dipspb$ vagrant ssh
Welcome to Ubuntu 16.10 (GNU/Linux 4.8.0-26-generic i686)
* Documentation: https://help.ubuntu.com
@dipspb
dipspb / ARMDebianUbuntu.md
Created January 17, 2017 15:48 — forked from Liryna/ARMDebianUbuntu.md
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

@dipspb
dipspb / new_stacked_rnns.py
Created October 2, 2017 16:59 — forked from fchollet/new_stacked_rnns.py
New stacked RNNs in Keras
import keras
import numpy as np
timesteps = 60
input_dim = 64
samples = 10000
batch_size = 128
output_dim = 64
# Test data.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dipspb
dipspb / redis_key_sizes.sh
Created March 7, 2018 17:21 — forked from epicserve/redis_key_sizes.sh
A simple script to print the size of all your Redis keys.
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}
@dipspb
dipspb / docker-compose.yml
Last active January 1, 2024 11:24
docker-compose.yml structuring example
version: "3.4"
# Prepare files for this example:
# mkdir -p ./a ./b ./c && touch a/a.txt b/b.txt c/c.txt
x-default-image: &x-default-image
image: ubuntu
x-default-cmd: &x-default-cmd
command: bash -c "echo $${HELLO} $${SVC_NAME} ; ls -al /tmp/*"