Skip to content

Instantly share code, notes, and snippets.

View gaga5lala's full-sized avatar
🐈

Gaga Pan gaga5lala

🐈
  • Tokyo
View GitHub Profile
@gaga5lala
gaga5lala / check_line_store.sh
Created November 8, 2016 03:53
Check whether sticker is ready for sale.
#!/bin/bash
result=$(curl -i https://store.line.me/stickershop/product/1343605 2>/dev/null | head -n 1 | cut -d$' ' -f2)
while [ $result -ne "200" ]
do
echo $result
sleep 60
done
@gaga5lala
gaga5lala / crontab
Created December 29, 2016 15:37
Send cron log to stdout (debian jessie)
* * * * * echo "Hello world" > /proc/$(cat /var/run/crond.pid)/fd/1 2>&1
#!/bin/bash
# Install docker and add permission your user.
bash <(curl -s https://get.docker.com)
# Add user to docker group
sudo usermod -aG docker `whoami`
@gaga5lala
gaga5lala / .vimrc
Created February 7, 2017 06:56
vim config file
set nocompatible " be iMproved, required
filetype off " required
"// --- vim-plugin --- //
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
# 175梯教育役服勤處所分配表
# http://maseduc.moe.gov.tw/board/upload/175%E6%A2%AF%E5%BD%99%E6%95%B4%E6%9C%8D%E5%8B%A4%E8%99%95%E6%89%80%E9%A0%90%E6%93%AC%E5%88%86%E9%85%8D%E8%A1%A8.xls
require 'spreadsheet'
workbook = Spreadsheet.open './175t.xls'
worksheets = workbook.worksheets
worksheets.each do |worksheet|
puts "Reading #{worksheet.name}"
@gaga5lala
gaga5lala / gaga_map.rb
Created May 19, 2017 03:03
Reimplement ruby map
class Array
def gaga_map(&blk)
puts "---method #{__method__} start---"
output = []
if block_given?
self.each do |item|
output << blk.call(item)
end
output = output.to_enum :gaga_map
@gaga5lala
gaga5lala / jupyter_shortcuts.md
Created September 22, 2017 04:47 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
@gaga5lala
gaga5lala / restore_docker_image_tag.sh
Created November 7, 2017 02:04
Restore docker image tag from text file.
# 1. Backup image tags to text file.
# $ docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" > img_id.txt
#
# 2. Execute clean-docker-for-mac script
# $ bash clean-docker-for-mac.sh $(docker images --format "{{.ID}}" | xargs)
#
# source: https://gist.github.com/MrTrustor/e690ba75cefe844086f5e7da909b35ce#file-clean-docker-for-mac-sh
#
# 3. Execute this script to restore tags from text file.
@gaga5lala
gaga5lala / The Technical Interview Cheat Sheet.md
Created December 6, 2017 03:05 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@gaga5lala
gaga5lala / hide_gitlab_system_note.js
Last active December 8, 2017 01:51
Bookmarklet to hide gitlab system notes. (e.g, issue edit history)
javascript:(function(){document.querySelectorAll("ul.notes .system-note").forEach(function(ele){ele.style.display ='none'})})()