Skip to content

Instantly share code, notes, and snippets.

;; 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 ()
#!/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
@ttakezawa
ttakezawa / emacs-latest.spec
Created January 3, 2013 12:21
CentOS6.3でemacs 24.2のRPM作成に使ったSPECファイル
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)
@ttakezawa
ttakezawa / CentOS-Base-source.repo
Last active December 10, 2015 12:48
If "http://vault.centos.org/$releasever/os/Source/" does not exist, then you should set releasever by doing the following. yumdownloader --source emacs --releasever=6.3
# 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]
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
# connect
my $dbh = DBI->connect(
'dbi:mysql:dbname=xyz',
'user',
'password'
@ttakezawa
ttakezawa / eRuby.rb
Created May 23, 2011 05:24
basic eRuby implementation
#!/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 = $`
@ttakezawa
ttakezawa / tree.pl
Created May 21, 2011 10:38
tree(1) like command
#!/usr/bin/perl
use strict;
use warnings;
my $dir_cnt = -1;
my $file_cnt = 0;
sub visit {
my ($dirname, $line_prefix) = @_;
$dir_cnt++;