Skip to content

Instantly share code, notes, and snippets.

View dorentus's full-sized avatar
🎲
🌎🌍🌏

ZHANG Yi dorentus

🎲
🌎🌍🌏
View GitHub Profile
$ ruby -ropenssl -e "puts OpenSSL::VERSION"
$ ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE'
@dorentus
dorentus / backup.sh
Created October 22, 2013 16:27 — forked from likuku/backup.sh
#!/bin/sh
# Warning!
# if you DIY a stage package like this,
# you must use the Stage3`s /etc/udev/*
# or rm /etc/udev/rules.d/70*
# Warning!
# last edited by likuku on 2012.03.29
DATE=`date +%Y_%m_%d_%H_%M_%S`
ARCH=`uname -m`
# Uncrustify 0.60
newlines = auto
input_tab_size = 4
output_tab_size = 4
string_escape_char = 92
string_escape_char2 = 0
tok_split_gte = false
utf8_bom = ignore
utf8_byte = false
utf8_force = false
id dynamicUITableViewDequeueReusableCellWithIdentifierForIndexPath(id self, SEL cmd, NSString *identifier, NSIndexPath *indexPath)
{
return [self performSelector:@selector(dequeueReusableCellWithIdentifier:) withObject:identifier];
}
void __compat_fix()
{
SEL aSEL = @selector(dequeueReusableCellWithIdentifier:forIndexPath:);
if (![UITableView instancesRespondToSelector:aSEL]) {
BOOL success = class_addMethod([UITableView class], aSEL, (IMP)dynamicUITableViewDequeueReusableCellWithIdentifierForIndexPath, "@@:@");
[color]
ui = auto
[push]
default = simple
[core]
editor = vim
quotepath = false
[alias]
lg = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative --show-signature
[branch]
diff -Naru libpng-1.5.13.org/png.h libpng-1.5.13/png.h
--- libpng-1.5.13.org/png.h 2012-09-30 19:13:07.000000000 +0900
+++ libpng-1.5.13/png.h 2012-09-30 19:13:07.000000000 +0900
@@ -442,6 +442,10 @@
# include "pnglibconf.h"
#endif
+#define PNG_APNG_SUPPORTED
+#define PNG_READ_APNG_SUPPORTED
+#define PNG_WRITE_APNG_SUPPORTED
@dorentus
dorentus / mruby.rb
Created February 6, 2013 08:10 — forked from kyohsuke/mruby.rb
require 'formula'
class Mruby < Formula
homepage 'http://www.mruby.org/'
head 'https://github.com/mruby/mruby.git'
def install
ENV.j1
system "make"
system "make test"
Use 'dpkg --get-selections > selections.txt' to save a selection and 'dpkg
--set-selections < selections.txt && apt-get dselect-upgrade' to restore.
@dorentus
dorentus / waaagh!
Created February 3, 2013 09:53
WAAAAAAAAAAAAAAAAAAAAAAAGH! for bash
type old_command_not_found_handle 2>/dev/null | grep -q 'is a function' > /dev/null
if [ $? -ne 0 ]; then
eval "$(echo "old_command_not_found_handle()"; declare -f command_not_found_handle | tail -n +2)"
fi
command_not_found_handle () {
if [[ ! "$1" ]] ; then
old_command_not_found_handle $@
return $?
fi
@dorentus
dorentus / 95-lolcat
Last active February 15, 2022 12:21
dynamically generated /etc/motd using fortune, cowsay & lolcat,save it as /etc/update-motd.d/95-lolcat.Google `pam_motd` or `update-motd` for more details of dynamically generated message-of-the-day.
#!/bin/bash
# see: http://blog.tomtung.com/2009/11/cowsay-fortune
# http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed
# https://github.com/busyloop/lolcat
# https://github.com/dorentus/mruby-lolcat-bin
#
# requires `fortune`, `cowsay`,
# and ruby gem `lolcat` or its mruby version equivalent
export LANG="en_US.UTF-8"