Skip to content

Instantly share code, notes, and snippets.

View fx-kirin's full-sized avatar
🌴
Somewhere on the planet.

fx-kirin fx-kirin

🌴
Somewhere on the planet.
View GitHub Profile
@markeganfuller
markeganfuller / disable_crontab_r
Created January 8, 2014 11:00
Disable crontab -r (remove)
# Disable crontab -r
function crontab ()
{
# Replace -r with -e
/usr/bin/crontab "${@/-r/-e}"
}
(function() {
void(d = document);
void(el = d.getElementsByTagName('link'));
void(g = false);
void(count = 0);
for (i = 0; i < el.length; i++) {
if (el[i].getAttribute('rel').indexOf('alternate') != -1) {
if(count == 0) {
ty = el[i].getAttribute('type');
if(ty.indexOf('application/rss+xml') != -1 || ty.indexOf('text/xml') != -1) {
@dogrunjp
dogrunjp / update_hicharts
Created March 26, 2014 06:23
Highchartsのデータをアップデートする方法はdestroy()〜とredraw()の2種類ある。destroy()して再描画した方が若干速いらしい。いずれもD3.jsのアップデートよりわかりやすい。(普通にjQueryなので…) ※マルチデータなline chartの例
##destro()〜なアップデート
#chart = new Highcharts.Chart(options)がすでに描画されているケースでは
$.getJSON('hoge.json',function(data){
chart.destroy()
options.xAxis = data[1];
options.series = data[0]['datas'];
chart = new Highcharts.Chart(options);
});
##redraw()を利用したアップデート
@7kry
7kry / w32example.py
Last active November 6, 2018 02:44
手持ちのPython 3環境で動かしたらちょっと手直しが必要だったので、まずフォーク。
# -*- coding: utf-8 -*-
# http://algomarket.wikidot.com/win32-api-in-python
# `Hello world in python using win32py'
# 手持ちのPython 3環境で動かしたらちょっと手直しが必要だったので、まずフォーク。
from win32api import (GetModuleHandle,)
from win32gui import (WNDCLASS,
GetStockObject,
RegisterClass,
@podhmo
podhmo / ctypes.example2.py
Created July 17, 2012 21:25
ctypes example . call qsort() with structure object (on python plane)
from ctypes import cdll
from ctypes import CFUNCTYPE, sizeof, POINTER, c_int
from ctypes import Structure
libc = cdll.LoadLibrary("libc.so.6")
import random
class Point(Structure):
_fields_ = [("x", c_int),
("y", c_int)]
@auneri
auneri / pipwin.py
Last active June 25, 2019 16:09
Downloads wheels from http://www.lfd.uci.edu/~gohlke/pythonlibs by name.
"""python -m pipwin pycuda-2016.1.2+cuda7518-cp34-cp34m-win_amd64.whl"""
from __future__ import absolute_import, division, print_function
import argparse
import os
import shutil
import tempfile
import sys
""" Sample App Code with Datatable """
# Import Supporting Libraries
import pandas as pd
# Import Dash Visualization Libraries
import dash_core_components as dcc
import dash_html_components as html
import dash_table_experiments as dt
import dash.dependencies
@dropwhile
dropwhile / install-setup.txt
Last active February 28, 2020 05:43
python serialization speed comparison
virtualenv --no-site-packages hodor
hodor/bin/pip install simplejson ujson cbor tnetstring msgpack-python
curl -s 'http://www.json-generator.com/api/json/get/cvfsLVmKiG?indent=2' > test.json
hodor/bin/python shootout.py
@y3nr1ng
y3nr1ng / paramiko_ssh_config.py
Last active July 14, 2021 10:07
Paramiko with .ssh/config
client = paramiko.SSHClient()
client._policy = paramiko.WarningPolicy()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_config = paramiko.SSHConfig()
user_config_file = os.path.expanduser("~/.ssh/config")
if os.path.exists(user_config_file):
with open(user_config_file) as f:
ssh_config.parse(f)
@z80oolong
z80oolong / 00_TMUX_FIX.md
Last active October 4, 2021 22:50
tmux 2.5 以降において East Asian Ambiguous Character を全角文字の幅で表示する

tmux 2.5 以降において East Asian Ambiguous Character を全角文字の幅で表示する

告知 (2019/03/15, 2020/04/29)

これまで、本稿の Gist にて公開しておりました [tmux 2.5][TMUX] 以降において [East Asian Ambiguous Character][EAWA] を全角文字の幅で表示する為の差分ファイルについて、差分ファイルの分量が多くなったことに伴い、今後は以下の [Github][GITH] のリポジトリにて [tmux][TMUX] の [East Asian Ambiguous Character][EAWA] 対応差分ファイルを公開することと致します。

また、今後 [East Asian Ambiguous Character][EAWA] 対応の [tmux][TMUX] の導入を御考えの方は、後述する [Linuxbrew][BREW] を用いた差分ファイルの適用及びインストール若しくは、 [AppImage パッケージ][APPR]を用いたインストールを御勧め致します。