Skip to content

Instantly share code, notes, and snippets.

View lululau's full-sized avatar
🎯
Focusing

FCP lululau

🎯
Focusing
  • Sunshine, Mountain East
View GitHub Profile
@lululau
lululau / cvim.rc
Created August 6, 2019 01:34
cVimrc
let blacklists = ["*://*.youku.com/*", "*://*.youtube.com/*", "*://youku.com/*", "*://youtube.com/*"]
map "h" goBack
map "l" goForward
map "H" scrollLeft
map "L" scrollRight
ActiveRecord::Base.connection.tap do |conn|
conn.tables.each do |table_name|
conn.primary_key(table_name).tap do |pkey|
table_name.camelize.tap do |const_name|
Class.new(ActiveRecord::Base) do
self.primary_keys = pkey
self.table_name = table_name
self.inheritance_column = nil
end.tap do |clazz|
Object.const_set(const_name, clazz).tap do |const|
#EXTM3U name="bj-unicom-iptv"
#EXTINF:-1,天津卫视高清
rtp:///239.3.1.141:1234
#EXTINF:-1,卡酷少儿
rtp:///239.3.1.50:9248
#EXTINF:-1,爱上4K
rtp:///239.3.1.236:2000
@lululau
lululau / iterm2-hotkey-window-profile.json
Last active February 26, 2019 14:11
iTerm2 Hotkey Window Profile
{
"Thin Strokes" : 1,
"Working Directory" : "\/Users\/liuxiang",
"Prompt Before Closing 2" : 0,
"Selected Text Color" : {
"Green Component" : 0.88235294818878174,
"Blue Component" : 0.86274510622024536,
"Red Component" : 0.90196079015731812
},
"Rows" : 25,
@lululau
lululau / emacs-mac-title-bar-7.4.patch
Last active January 16, 2020 11:30
emacs-mac-title-bar-7.4.patch
diff -Nur mituharu-emacs-mac-fd1cf1f3e757/src/macappkit.m 74/src/macappkit.m
--- mituharu-emacs-mac-fd1cf1f3e757/src/macappkit.m 2018-11-16 17:38:56.000000000 +0800
+++ 74/src/macappkit.m 2018-11-17 23:03:48.000000000 +0800
@@ -2098,6 +2098,18 @@
@implementation EmacsWindow
++ (NSButton *)standardWindowButton:(NSWindowButton)b forStyleMask:(NSWindowStyleMask)styleMask
+{
+
@lululau
lululau / DefaultKeyBinding.dict
Created October 28, 2018 14:57 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@lululau
lululau / .vimrc
Last active October 10, 2018 14:53
Simplified .vimrc
"
" Author: Larry Lv <larrylv1990@gmail.com>
" Last Modified: May 14, 2014
"
filetype off " required by vundle
let s:uname = substitute(system('uname'), "\n", "", "")
@lululau
lululau / emacs-mac-title-bar-7.2.patch
Last active September 11, 2018 14:46
emacs-mac-title-bar-7.2.patch
--- mituharu-emacs-mac-7fdbfba85d54/src/macappkit.m 2018-09-09 09:02:50.000000000 +0800
+++ mituharu-emacs-mac-7.1/src/macappkit.m 2018-09-11 22:29:44.000000000 +0800
@@ -2074,6 +2074,18 @@
@implementation EmacsWindow
++(NSButton *)standardWindowButton:(NSWindowButton)b forStyleMask:(NSWindowStyleMask)styleMask
+{
+
+ NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
@lululau
lululau / test.c
Created May 29, 2018 08:58
Append Write to File is ATOMIC!
#include <unistd.h>
#include <fcntl.h>
#include <strings.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
/* printf("%s\n", argv[1]); */
/* printf("%s\n", argv[2]); */
@lululau
lululau / IntellijActionNameList.txt
Created April 8, 2018 14:28
Intellij Action Name List
--- Actions ---
$Copy <A-C> <Esc> <M-C>
$Cut <S-Del>
$Delete <Del> <C-D>
$LRU
$Paste <A-P> <C-Y> <M-V>
$Redo <C-S-Z> <A-S-->
$SearchWeb
$SelectAll <C-X>
$Undo <C-S--> <C-/>