Skip to content

Instantly share code, notes, and snippets.

View yehjames's full-sized avatar

James Yeh yehjames

  • Dcard
  • Taiwan, Taipei
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yehjames
yehjames / test.ipynb
Last active September 23, 2017 14:24
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yehjames
yehjames / tmux-cheatsheet.markdown
Created August 12, 2017 13:01 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
class Solution:
def lcp(self, str1, str2):
i = 0
while (i < len(str1) and i < len(str2)):
if str1[i] == str2[i]:
i = i+1
else:
break
return str1[:i]
class Solution:
def rotateString(self, A, offset):
if A is None or len(A) == 0:
return A
offset %= len(A)
self.reverse(A, 0, len(A)-offset-1)
self.reverse(A, len(A)-offset, len(A)-1)
self.reverse(A, 0, len(A)-1)