This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; https://wwwtech.de/articles/2011/jul/emacs-restore-last-frame-size-on-startup | |
;; | |
;; Installation: | |
;; | |
;; Add the following to your emacs init file: | |
;; | |
;; (el-get-bundle gist:218fd80d9390845bf9dcad727237d4af:save-framegeometry | |
;; :features save-framegeometry) | |
(defun save-framegeometry () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This is inspired by https://gist.github.com/xaicron/5524548, but this doesn't require mysqlenv and zsh | |
# | |
# Prepare (for CentOS): | |
# cpanm MySQL::Sandbox | |
# sudo yum install cmake ncurses-devel | |
# mkdir -p ~/opt/mysql | |
# git clone git://github.com/kamipo/mysql-build.git ~/opt/mysql/mysql-build | |
# ~/opt/mysql/mysql-build/bin/mysql-build -v 5.1.69 ~/opt/mysql/5.1.69 | |
# make_sandbox 5.1.69 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name: emacs-latest | |
Version: 24.2 | |
Release: 1%{?dist} | |
Summary: GNU Emacs | |
#Group: | |
License: GPL | |
URL: http://www.gnu.org/software/emacs/ | |
Source0: http://ftp.gnu.org/pub/gnu/emacs/emacs-24.2.tar.xz | |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CentOS-Base-source.repo | |
[base-source] | |
name=CentOS-$releasever – Base Source | |
baseurl=http://vault.centos.org/$releasever/os/Source/ | |
gpgcheck=1 | |
enabled=0 | |
gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-6 | |
[updates-source] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use DBI; | |
# connect | |
my $dbh = DBI->connect( | |
'dbi:mysql:dbname=xyz', | |
'user', | |
'password' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# via [ruby-list:48093] | |
def eRuby(eruby_source) | |
source = eruby_source | |
ruby = '' | |
loop do | |
break if source.empty? | |
if source=~/<%=/m | |
text = $` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $dir_cnt = -1; | |
my $file_cnt = 0; | |
sub visit { | |
my ($dirname, $line_prefix) = @_; | |
$dir_cnt++; |