Skip to content

Instantly share code, notes, and snippets.

View kkawamura's full-sized avatar

kkawamura kkawamura

  • Self-Employed
  • Kanagawa, Japan
View GitHub Profile
@kkawamura
kkawamura / gist:6090eb1af049b8d94298bb2be908d676
Last active March 28, 2020 03:05
rebuild python env in local machine
現状
だいぶ前にpyenv, anacondaの併用がうまくできずいろいろadhocな作業したせいで、ローカルpython環境が腐ってるので直す
[~/IdeaProjects/spaas-airflow]$ which python
/usr/bin/python
[~]$ pyenv
-bash: pyenv: command not found
[~]$ cat ~/.bash_profile |grep py
@kkawamura
kkawamura / index.html
Created August 13, 2013 04:10
iPhone SMS Style
<!DOCTYPE html>
<head>
<title>Chat</title>
<meta charset="utf-8"></meta>
<style type="text/css">
body { background-color: #dbe2ed }
.container {
width: 688px;
margin: 0 auto;
@kkawamura
kkawamura / out_roma.rb
Created August 9, 2013 10:32
pluginの練習w
module Fluent
class RomaOutput < BufferedOutput
Fluent::Plugin.register_output('roma', self)
#config_param :host, :string, :default => 'localhost'
def initialize
super
require 'roma/client'
end
@kkawamura
kkawamura / date.sh
Created June 14, 2013 07:34
generate date list by shellscript
#!/bin/sh
start_date="20120601"
end_date="20120610"
i=0
while [ 1 ] ;do
now=`date +%Y%m%d -d "$start_date + $i days"`
echo $now
# command
javascript:(function(){var d=document;var s=d.createElement('script');s.src='https://gist.github.com/kkawamura/5713927/raw/76c466ce3e1b1f4cf0f53d822306450ff8066c5f/test2.js'; d.body.appendChild(s)})();
(function(){
var total = 0;
var year = '2012';
function init(num) {
num = (typeof num !== 'number' ? 0 : num);
if(num === 0) {
$('<div/>').css({
position: 'fixed',
left: 0,
top: 0,
(function(){
var total = 0;
var year = '2012';
function init(num) {
num = (typeof num !== 'number' ? 0 : num);
if(num === 0) {
$('<div/>').css({
position: 'fixed',
left: 0,
top: 0,
@kkawamura
kkawamura / test2.js
Last active December 18, 2015 02:49
(function(){
var total = 0;
var year = '2012';
function init(num) {
num = (typeof num !== 'number' ? 0 : num);
if(num === 0) {
$('<div/>').css({
position: 'fixed',
left: 0,
top: 0,
var str = "19,000円";
now = str.match(/^([0-9,]*)円$/)[1];
now = now.replace(/\,/,"");
now = parseInt(now);
price = 10;
alert(now+price);
alert(now);
@kkawamura
kkawamura / test.js
Last active December 18, 2015 02:39
(function(){
function number_format(num){
return num.toString().replace(/([\d]+?)(?=(?:\d{3})+$)/g, function(t){ return t + ','; });
}
function sum_history(){
var elements = document.getElementsByClassName('itemPriceAmount');
var total = 0;
for(var i=0; i<elements.length; i++){