Skip to content

Instantly share code, notes, and snippets.

View search_tweet.py
# -*- coding: utf-8 -*-
from requests_oauthlib import OAuth1Session
import json
import settings
import os
import sys
if len(sys.argv) != 2:
print("Please input search keyword!")
View gce-startup.sh
#!/bin/sh
USERNAME="s4kr4m4"
INITIALIZED_FLAG=".initialize_completed"
main()
{
if test -e $INITIALIZED_FLAG; then
update
else
View upload-gmusic.py
from gmusicapi import Musicmanager
import sys
argv = sys.argv
exts = ['.mp3', '.m4a', '.wma', '.flac', '.ogg', '.m4p']
mm = Musicmanager()
mm.login()
for ext in exts:
@s4kr4
s4kr4 / github_contributions.rb
Last active Dec 27, 2017
日毎のContributions数をCSV形式で取得するやつ
View github_contributions.rb
require 'no_proxy_fix'
require 'open-uri'
require 'oga'
base_uri = "https://github.com/s4kr4"
html = open(base_uri) do |f|
f.read
end
View rainbow
#!/bin/bash
colors=("" "" "" "" "" "")
color_end=""
length=$((${#1} - 1))
for i in `seq 0 1 $length`
do
index=$((i%6))
View get_ssid_tmux
#!/bin/zsh
. "$DOTPATH"/.zsh/20_functions.zsh
if [ is_cygwin ]; then
network_info=(`netsh wlan show interfaces | sed -e 's/\s//g' | awk -F : '{print $2}'`)
state=${network_info[5]}
ssid=${network_info[6]}
signal=${network_info[15]}
View lifegame.py
#LIFEGAME
from random import *
from Tkinter import *
cell = 10
height = 60 + 2
width = 60 + 2
frame = 5
field = []
@s4kr4
s4kr4 / scraping.rb
Last active May 10, 2017
Get Cinderella Girls
View scraping.rb
require 'open-uri'
require 'Oga'
base_uri = "http://imas.gamedbs.jp"
def open_uri(uri)
html = open(uri) do |f|
f.read
end
@s4kr4
s4kr4 / cvim.css
Created Feb 10, 2017
CSS for cVim
View cvim.css
#cVim-command-bar, #cVim-command-bar-mode, #cVim-command-bar-input, #cVim-command-bar-search-results,
.cVim-completion-item, .cVim-completion-item .cVim-full, .cVim-completion-item .cVim-left,
.cVim-completion-item .cVim-right {
font-family: Helvetica, Helvetica Neue, Neue, sans-serif, monospace, Arial;
font-size: 10pt !important;
-webkit-font-smoothing: antialiased !important;
}
#cVim-command-bar {
position: fixed;
@s4kr4
s4kr4 / init.lua
Created Jan 15, 2017
hammerspoon
View init.lua
local prefix = {"cmd", "ctrl"}
hs.hotkey.bind(prefix, "Up", function()
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
local max = screen:frame()
f.x = max.x
f.y = max.y