Skip to content

Instantly share code, notes, and snippets.

View alice1017's full-sized avatar

Alice1017 alice1017

  • Tokyo, Japan
View GitHub Profile
#!/bin/bash
# coding: utf-8
BINPATH="/usr/bin"
SSH_AGENT="${BINPATH}/ssh-agent"
SSH_ADD="${BINPATH}/ssh-add"
FILE="/tmp/ssh-agent.sh"
SSH_ADD_ARGUMENTS=$@
delete_exists_proc() {

Version Notation

Numeric Version

Major and Minor

For example: Version 2.1

Major Minor
@alice1017
alice1017 / column-display.py
Created May 9, 2018 16:01
Display the list object with column-format.
def separate(items, num):
for index in range(0, len(items), num):
yield items[index:(index + num)]
def display_list(template_list):
sepnum = 3
lines = [""] * sepnum
@alice1017
alice1017 / ssh-agent-add-kill.py
Last active May 8, 2018 15:12
(ssh-agent by delegator.py -> ssh-add by os.system -> kill ssh-agent process by os.kill) by Python
#!/usr/bin/env python
# coding: utf-8
import os
import delegator as dg
from signal import SIGKILL
from termcolor import colored
RUN = colored("RUN", "cyan")
SET = colored("SET", "green")
#!/bin/sh
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
echo "$changed_files" | grep --quiet "\.jinja2$" && eval "python make.py compile"
@alice1017
alice1017 / enhanced_python.py
Last active August 2, 2017 01:39
Enhanced Python Interpreter supported keybind, history, autosuggestion
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import sys
import click
from code import InteractiveConsole
from pygments.lexers import PythonLexer
@alice1017
alice1017 / 1200gs.css
Created June 21, 2017 07:38
1200 grid system
.container_12 {
width: 1200px;
margin-left: auto;
margin-right: auto
}
.grid_1 {
position: relative;
display: inline;
float: left;
snippet #!
abbr #!/usr/bin/env python
alias shebang
options head
#!/usr/bin/env python
# coding: utf-8
snippet class
abbr class Class(...): ...
options head
@alice1017
alice1017 / 電卓プログラム.py
Last active May 27, 2017 02:54
対話的な電卓プログラム(メモリー機能つき)
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) 2016 Hayato Tominaga
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@alice1017
alice1017 / apiparse.py
Last active January 11, 2022 22:05
The web API parser: analyze web API from sample url, and return API object.
#!/usr/bin/env python
# coding: utf-8
import json
import requests
from urllib import unquote
from urlparse import urlparse