Skip to content

Instantly share code, notes, and snippets.

@ysmood
ysmood / gplus-auto-hide-photo-comment.css
Last active December 17, 2015 14:39
Auto-hide the googleplus's photo comment column.
.KmGBLb {
right: -300px !important;
z-index: 1004;
-webkit-transition: all .15s cubic-bezier(0,1.12,.39,.98);
-moz-transition: all .15s cubic-bezier(0,1.12,.39,.98);
-ms-transition: all .15s cubic-bezier(0,1.12,.39,.98);
-o-transition: all .15s cubic-bezier(0,1.12,.39,.98);
transition: all .15s cubic-bezier(0,1.12,.39,.98);
}
.KmGBLb:hover {
@ysmood
ysmood / osx_zshrc.sh
Created May 22, 2013 09:48
A zshrc with some common settings.
#!/usr/bin/env bash
# Default zsh runcom.
# Oct 2012 y.s.
################################### OH-MY-ZSH Settings ##########################################
# If your current shell is not zsh, try to change your default shell to zsh.
if [[ $0 != '-zsh' ]]; then
echo "Your default shell is not zsh."
@ysmood
ysmood / cocoa_launchApp.m
Created June 24, 2013 18:45
Example: Cocoa launch application via path.
+ (void) launchApp:(NSString *)path {
NSURL *url = [NSURL fileURLWithPath:path];
NSError *err = nil;
if ([url checkResourceIsReachableAndReturnError:&err]) {
[[NSWorkspace sharedWorkspace] launchApplication:[url path]];
} else {
NSLog(@"%@", [err localizedDescription]);
}
}
@ysmood
ysmood / gplus_clear_posts_btn.coffee
Last active December 19, 2015 13:09
A tool for G+ to remove all the loaded posts.
# A tool for G+ to remove all the loaded posts.
# This tool may be helpful when you have loaded lots of posts, and your browser is to slow to loading any more.
# You can trigger it either by press "C" or click the "Clear Posts" button.
# Jul 2013 ys
init = ->
stream_stage = document.querySelector('.wIa')
if stream_stage == null
return
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
# Mar 2013 Yad Smood
# VCS
YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
YS_VCS_PROMPT_PREFIX2=":%{$fg[cyan]%}"
@ysmood
ysmood / temp.sh
Last active December 21, 2015 05:18
ks() {
cur_dir=(pwd)
cd /opt/katawa-shoujo
Katawa\ Shoujo.sh
cd cur_dir
}
@ysmood
ysmood / ruby_var_test.rb
Created August 17, 2013 09:42
Performance test of the variable in different scopes.
$g = 10
def fun_g a
a += $g
end
def fun_l a
l = 10
a += l
end
@ysmood
ysmood / tail_recursion.c
Last active December 22, 2015 23:19
gcc test: `gcc -O3 tail_recursion.c`
#include "stdio.h"
void foo(x) {
printf("%d\n", ++x);
foo(x);
}
int main(int argc, char const *argv[]) {
foo(1);
return 0;
@ysmood
ysmood / archlinux_installation_guide.md
Last active December 23, 2015 15:29
archlinux_installation_guide

Archlinux Installation Guide

  1. Select kernel version "Other Linux 3.x kernel".
  2. Set the vm's hardware resource limitation.
  3. Boot Arch.
  4. Partition.
  • Show disk list: fdisk -l
  • Create partition: cfdisk /dev/sda 0. /dev/sda1 for boot. Primary, Bootable
  1. /dev/sda2 for swap. Primary, Type 82
@ysmood
ysmood / g.py
Created October 27, 2013 04:59
low = 0
high = 100
guess_number = (low + high) / 2
print("Please think of a number between 0 and 100!")
while True:
char = raw_input("Is your secret number " +
str(guess_number) + "?\n" +
"Enter 'h' to indicate the guess is too high." +
"Enter 'l' to indicate the guess is too low." +