Skip to content

Instantly share code, notes, and snippets.

View masaru-b-cl's full-sized avatar

TAKANO Sho / @masaru_b_cl masaru-b-cl

View GitHub Profile
@masaru-b-cl
masaru-b-cl / bar.js
Created December 26, 2012 21:02
「Backbone.js:別ファイル定義のViewではelの定義にjQueryオブジェクトを使ってはいけない」のサンプル用bar.js
/// <reference path="http://code.jquery.com/jquery-1.8.3.js"/>
/// <reference path="backbone-0.9.9.js" />
var Bar = Backbone.View.extend({
initialize: function(){
this.render();
},
render : function(){
this.$el.text("bar");
}
});
@masaru-b-cl
masaru-b-cl / .gitignore
Last active December 11, 2015 03:08
ResourceTestConsoleApplication
bin/
obj/
*.suo
*.user
@masaru-b-cl
masaru-b-cl / .gitignore
Last active December 11, 2015 03:08
NestedRepeaterWebApplication
bin/
obj/
*.suo
*.user
bin/
obj/
*.suo
*.user
TestResults/
@masaru-b-cl
masaru-b-cl / .gitignore
Last active December 11, 2015 03:08
[email protected]:masaru-b-cl/ASP.NET-MVC-3-Training.git
bin/
obj/
*.suo
*.user
@masaru-b-cl
masaru-b-cl / .gitconfig
Created January 15, 2013 20:03
git-credential-winstoreを使うための.gitconfig設定
[credential]
helper = !'git-credential-winstore.exe'
@masaru-b-cl
masaru-b-cl / install-git-credential-winstore.sh
Created January 15, 2013 20:11
git-credential-winstoreインストール用git configコマンド
git config --global credential.helper \!git-credential-winstore.exe
@masaru-b-cl
masaru-b-cl / .gitignore
Last active December 11, 2015 05:58
Visual Studio Advent Calendar 2012 sample code TypeScriptでWSHを書いちゃおう #visualstudio – @masaru_b_cl « be free http://takanosho.wordpress.com/2012/12/24/visual-studio-advent-calendar-2012/
Thumbs.db
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
@masaru-b-cl
masaru-b-cl / substringByShiftJISBytesCount.java
Created January 25, 2013 00:40
文字列をShiftJISとして扱って先頭から指定したバイト数分切り出す。最後の文字がマルチバイト文字だった場合、切り落とす。
protected String substringByShiftJISBytesCount(String source, int bytesCount)
throws UnsupportedEncodingException {
if (source == null) return source;
byte[] bytes = source.getBytes("MS932");
if (bytes.length < bytesCount) return source;
String result = new String(bytes, 0, bytesCount, "MS932");
String last = result.substring(result.length() -1);
String lazt = new String(last.getBytes("MS932"), "MS932");
if (!last.equals(lazt)) {
result = result.substring(0, result.length()-1);
@masaru-b-cl
masaru-b-cl / Program.cs
Created February 8, 2013 06:31
DynamicLTSV usage
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DynamicLTSVSample
{
class Program
{