Skip to content

Instantly share code, notes, and snippets.

View yamaya's full-sized avatar

Masayuki Yamaya yamaya

  • Sapporo, Hokkaido, Japan
View GitHub Profile
#version 150
uniform sampler2D uTexture;
in VertexData {
vec3 baricentric;
vec4 color;
vec2 texcoord;
} vVertexIn;
@bolinfest
bolinfest / -
Created April 23, 2014 23:56
main.c
#include <clang-c/Index.h>
#include <stdio.h>
#include <stdlib.h>
void printCodeCompletionSuggestions(CXTranslationUnit tu, char* source, unsigned line, unsigned column) {
struct CXUnsavedFile *unsavedFiles = NULL;
unsigned numUnsavedFiles = 0;
unsigned options = clang_defaultCodeCompleteOptions();
CXCodeCompleteResults *results = clang_codeCompleteAt(tu, source, line, column, unsavedFiles, numUnsavedFiles, options);
##### Uncrustify config
# Objective-C
# ===== Preprocessor =====
# via: http://qiita.com/items/dd7c5ffdff27451dae16
# #if、#ifdef、#ifndef〜#else〜#endifブロック内のプロプロセッサをインデントするかどうか。{ ignore, add, remove, force }
pp_indent = add
# ソースコードのインデントレベルに合わせてインデントするかどうか。{ true, false }
pp_indent_at_level = true
var dict = Dictionary<String,Bool>()
dict["a"] = true
dict["c"] = false
func matchOneOrTheOtherWithOptionals(a: Bool?, b: Bool?) -> String {
switch (a, b) {
case (.Some(true), let b) where b == .None || !b!:
return "a was true, but b was None or false"
case (let a, .Some(true)) where a == .None || a == .Some(false):
@comuttun
comuttun / KeySetting.diff
Created October 19, 2014 18:38
Change Space and Shift+Space behavior for JapaneseIM on OS X Yosemite
diff --git a/KeySetting_Ainu.plist b/KeySetting_Ainu.plist
index 197b151..809b6b8 100644
--- a/KeySetting_Ainu.plist
+++ b/KeySetting_Ainu.plist
@@ -13,14 +13,14 @@
<key>command</key>
<string>direct_input</string>
<key>character</key>
- <string> </string>
+ <string> </string>
if expand('%') =~# '_spec\.rb$'
syn keyword rubyRspec describe context it specify it_should_behave_like before after setup subject
endif
hi def link rubyRspec Function
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("www.tumblr.com"),
domain("www.tumblr-beta.com")
{
ol#posts li blockquote,
body.mceContentBody blockquote {
margin-left: 0 !important;
margin-right: 0 !important;
padding-left: 3px !important;
#!/usr/bin/env ruby
# vim: encoding=utf-8 filetype=ruby
require 'rubygems'
require 'optparse'
require 'yaml'
options = YAML.load(<<CONF)
color: true
verbose: false
@koyachi
koyachi / gist:765964
Created January 5, 2011 05:13
ビルドオプション毎(アクティブな構成, ターゲット, architecture等)にバージョン情報を変える
XCodeの'グループとファイル'画面でターゲット選択、新規ビルドフェーズ(新規スクリプト)を追加
スクリプトフェーズを最初に持ってくる('バンドルリソースをコピー'の前に持ってくる)
YourProject-Info.plistにVersionValueとVersionValueForDisplayキーを追加。VersionValueに\d+.\d+.\d+な文字列を入れる
スクリプトに以下を書く
VERSION=`cat ./YourProject-Info.plist | tr -d '\n\t' | perl -nle 'print ($_ =~ /^.*?<key>VersionValue<\/key><string>(\d+\.\d+\.\d+)<\/string>.*$/) ? $1 : ""'`
VERSION_FOR_DISPLAY=$VERSION-$CONFIGURATION-$ARCHS
/usr/libexec/PlistBuddy -c "Set :VersionValueForDisplay $VERSION_FOR_DISPLAY" ./YourProject-Info.plist
- (void)scan {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
ALAssetsGroupType sources = ALAssetsGroupLibrary | ALAssetsGroupSavedPhotos;
NSMutableArray *tags = [[NSMutableArray alloc] init];
ALAssetsGroupEnumerationResultsBlock assetsEnumerator = ^(ALAsset *result, NSUInteger index, BOOL *stop){
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (result) {
if ([[result valueForProperty:ALAssetPropertyType] isEqual:ALAssetTypePhoto]) {