Skip to content

Instantly share code, notes, and snippets.

@ysheng26
ysheng26 / keyrepeat.shell
Created April 24, 2018 15:31 — forked from kconragan/keyrepeat.shell
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
{
"editor.fontSize": 14,
"editor.renderLineHighlight": "none",
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"editor.rulers": [
80
],
"editor.renderWhitespace": "all",
"vim.disableExtension": true,
"vim.useSystemClipboard": true,
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := 1.0
var old float64
@ysheng26
ysheng26 / gist:bc0e0cdf740e2934bc467dfdc081b8e7
Last active July 19, 2016 01:11
Microsoft Natural Ergonomic 4000 for Ubuntu
On Xubuntu 13.10 (perhaps on Ubuntu 13.10 too) the same can be done as follows:
Edit key mappings in /lib/udev/hwdb.d/60-keyboard.hwdb:
###########################################################
# Microsoft
###########################################################
# Microsoft Natural Ergonomic Keyboard 4000
keyboard:usb:v045Ep00DB*
@ysheng26
ysheng26 / multiple_ssh_setting.md
Created June 30, 2016 19:59 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@ysheng26
ysheng26 / solarized.bash
Created June 11, 2016 03:15 — forked from kraft001/solarized.bash
solarized Gnome Terminal + Tmux + Vim
# store all solarized files in one place
mkdir ~/.solarized
cd ~/.solarized
# http://www.webupd8.org/2011/04/solarized-must-have-color-paletter-for.html
git clone https://github.com/seebi/dircolors-solarized.git
eval `dircolors ~/.solarized/dircolors-solarized/dircolors.256dark`
ln -s ~/.solarized/dircolors-solarized/dircolors.256dark ~/.dir_colors
git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git
@ysheng26
ysheng26 / interviewitems.MD
Created January 27, 2016 02:43 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@ysheng26
ysheng26 / uNoWatermark.py
Last active September 10, 2015 22:29
Removes the annoying watermarks of it-ebooks.info's downloaded eBooks
import re
import shutil
import argparse
from os import path
from sys import stderr
#
# Author: Daxda
# Date: 02.04.2014
# WTF: This is a quick tool I've hacked together to easily remove the meta
// sloppy traceroute clone
// inpired by https://blogs.oracle.com/ksplice/entry/learning_by_doing_writing_your
// and made possible by https://www.npmjs.org/package/raw-socket
var raw = require('raw-socket');
var dns = require('dns');
var target = process.argv[2] || '173.230.146.29';
var MAX_HOPS = 64;
var TIME_LIMIT = 5000;
@ysheng26
ysheng26 / find.c
Last active August 29, 2015 14:17 — forked from cvonkleist/find.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <openssl/evp.h>
// compile with: gcc -lssl find.c