Skip to content

Instantly share code, notes, and snippets.

@vifo
vifo / gist:1709257
Created January 31, 2012 06:38
ExtJS 3.4.0 suspend event handlers.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hello world</title>
<link rel="stylesheet" type="text/css" href="http://cdn.sencha.io/ext-3.4.0/resources/css/ext-all.css" />
<style type="text/css">
html,body {
font-family: Verdana, Arial, Helvetica, sans-serif;
@vifo
vifo / gist:1722379
Created February 2, 2012 08:37
Perl File::Find example
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use Data::Dumper;
use File::Find;
sub wanted {
@vifo
vifo / go.sh
Created April 13, 2012 18:01
Configure, build and install ImageMagick 6.7.6.5 + PHP Imagick 2.3.0 under Ubuntu 10.04.4 LTS (with VPS OpenMP performance workaround)
#!/bin/sh
# ------------------------------------------------------------------------
# Configure, build and install ImageMagick 6.7.6.5 and PHP Imagick 2.3.0
# under Ubuntu 10.04.4 LTS.
#
# This script will automatically download, configure and build both
# software packages mentioned above and install them in /usr/local.
#
# In order to address performance problems with VPS systems and OpenMP,
# OpenMP will be dissabled. See following links for more information:
@vifo
vifo / cpannti.sh
Created May 17, 2012 12:15
Perl: "notest install module" from shell using CPAN
#!/bin/sh
# Usage: cpannti.sh <module_names>
# cpan (i.e. App::Cpan) does not provide a direct way to install modules without
# testing them, as you can do in the CPAN shell with:
#
# cpan[1]> notest install FooBarBaz
#
# App::Cpan uses CPAN::Shell under the hood to perform installation, so let's do
@vifo
vifo / install.sh
Created September 26, 2012 09:05
Ruby: Install Ruby 1.9.3-p327 via rvm with cumulative performance patch
#!/usr/bin/env bash
#
# This script will install Ruby 1.9.3-p327 via rvm with additional performance
# patches for faster Rails boot. Please refer to
#
# https://gist.github.com/1688857
#
# for detailed information. Run directly with:
#
# curl https://raw.github.com/gist/3786925/install.sh | bash
@vifo
vifo / ruby_gcc_settings.sh
Created November 27, 2012 19:43
Ruby: Default CFLAGS for building
#!/usr/bin/env bash
export CFLAGS="-march=native -O3 -Wall -pipe -fomit-frame-pointer"
export CXXFLAGS="${CFLAGS}"
export LANG=en_US.utf8
unalias cp mv >/dev/null 2>&1
@vifo
vifo / gist:4443720
Created January 3, 2013 14:09
Bash: Get directory current script is located in (with Bash 2 fallback)
#!/usr/bin/env bash
SCRIPT_PATH="${BASH_SOURCE[0]}" # for Bash > 3.0
[ -z "${SCRIPT_PATH}" ] && SCRIPT_PATH=$(readlink -f "$0") # for Bash 2
SCRIPT_DIR=$(cd $(dirname "${SCRIPT_PATH}") && pwd)
echo "Script path: ${SCRIPT_PATH}"
echo "Script directory: ${SCRIPT_DIR}"
@vifo
vifo / install_perlbrew.sh
Last active July 24, 2018 17:37
Perl: Install latest stable Perl via perlbrew with custom perlbrew root and options.
#!/usr/bin/env bash
export CC="gcc"
export CFLAGS="-march=native -O2 -Wall -pipe"
export CXXFLAGS="-march=native -O2 -Wall -pipe"
export PERLBREW_ROOT="/usr/local/perl"
export PERLBREW_CONFIGURE_FLAGS="-Dcc=gcc -Dinstallusrbinperl=n -Dpager=\"/usr/bin/sensible-pager\" -Uman1dir -Uman3dir -Usiteman1dir -Usiteman3dir -Uuseshrplib -Uusethreads -Uvendorman1dir -Uvendorman3dir -des"
curl -L http://install.perlbrew.pl | bash
@vifo
vifo / cleanup_linux_mint_15.sh
Last active October 5, 2018 22:49
Cleanup temporary files and caches on Linux Mint 15
#!/usr/bin/env bash
#
# Cleanup temporary files on a Linux Mint 15 Olivia installation.
#
# This script will happily wipe all root/user temporary files, old kernels,
# browser caches and cpan/cpanm build directories. Review before running
# blindly.
#
# Though, so far, there are no Linux Mint 15 Olivia specific cleanups here,
# this script ensures, that we're really running under this distribution. Feel
@vifo
vifo / Config.pm
Created January 18, 2014 17:53
Perl 5.18.2 CPAN Config.pm
# CPAN configuration for Perl 5.18.2 running under perlbrew. Install with:
#
# \$curl https://gist.github.com/vifo/8493828/raw/Config.pm \
# >/usr/local/perl/perls/perl-5.18.2/lib/5.18.2/CPAN/Config.pm
#
# to use as side-wide CPAN configuration.
$CPAN::Config = {
'applypatch' => q[],
'auto_commit' => q[1],