Skip to content

Instantly share code, notes, and snippets.

masakiplus

Block or report user

Report or block masakiplus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@masakiplus
masakiplus / 0_reuse_code.js
Created Feb 5, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View test.sh
#!/bin/bash
itemcount=0
subcount=1
for a in `ls G*.JPG 2> /dev/null`
do
echo "$a"
lastproduct="$productid"
productid=`echo "$a" | gawk '{print substr($a, 9,6)}'`
@masakiplus
masakiplus / exec.bat
Last active Aug 29, 2015
auto mail sender
View exec.bat
@echo off
rem smail.exe installation required
set pdfpath=%1
set smailpath="exeplace"
set smtp=smtp.gmail.com
set from=hoge@gmail.com
set to="hoge@gmail.com"
for /f "delims=;" %%i in ('dir /b /od %pdfpath%\*.pdf') do (
View gist:4572623
#! /usr/bin/sh
INPUT_FILE=data1
OUTPUT_FILE=data2
awk -c '
BEGIN {
FS = "\t" # TAB chara fow win platform
OFS = "\t"
REC_N = 15 # column number
@masakiplus
masakiplus / importer.sql
Created Dec 19, 2012
stored procedure to import csv
View importer.sql
-- 取り込み用ローデータの削除
DELETE [r_tbl];
-- データの取り込み実施
BULK INSERT [r_tbl] from 'raw.txt' WITH
(
FIELDTERMINATOR = '\t',
ROWTERMINATOR = '0x0a'
);
@masakiplus
masakiplus / procedure.py
Created Dec 19, 2012
python script to exec procedure
View procedure.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pymssql
#DB接続
conn = pymssql.connect(host='server', user='user', password='pass', database='dbname')
cur = conn.cursor()
#ストアド・プロシージャ実行
v_sql = 'exec [dbo].[importer]'
@masakiplus
masakiplus / acquisition.sh
Created Dec 19, 2012
Shell Script for data acquisition
View acquisition.sh
#!/bin/bash
# 各種設定:パスワードはパラメータから取得
HOST=hoge
USER=fuga
PASS=fugafuga
TARGET_DIR=/home/user/xxx/
BACKUP_DIR=/home/user/xxx/
SCRIPT_DIR=/home/user/script/
@masakiplus
masakiplus / gist:3927063
Created Oct 21, 2012
flurry sdk android
View gist:3927063
import com.flurry.android.FlurryAgent;
@Override
protected void onStart()
{
super.onStart();
FlurryAgent.onStartSession(this, "YOUR_API_KEY");
}
@Override
View gist:3927056
#import "Flurry.h"
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
[Flurry startSession:@"YOUR_API_KEY"];
//your code
}
View gist:3927055
#import "Flurry.h"
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
[Flurry startSession:@"YOUR_API_KEY"];
//your code
}
You can’t perform that action at this time.