Skip to content

Instantly share code, notes, and snippets.

@nana4gonta
nana4gonta / file0.txt
Created October 24, 2015 15:11
Visual Studio 2015でNodeの最新版を認識させる ref: http://qiita.com/nana4gonta/items/9c4b2b70a4f429f0d301
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\git\git.exe
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\node.cmd
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\npm.cmd
@nana4gonta
nana4gonta / file0.txt
Created May 6, 2015 03:24
msys2での$HOMEとOpenSSHでのホームディレクトリの違い ref: http://qiita.com/nana4gonta/items/622571c66bfe7f1c7150
$ git pull
Could not create directory '/home/username/.ssh'.
The authenticity of host 'github.com (192.30.252.131)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/username/.ssh/known_hosts).
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
@nana4gonta
nana4gonta / decorators.js
Last active August 29, 2015 14:18
TypeScript 1.5 Alphaに入ったDecoratorsは何をするのか ref: http://qiita.com/nana4gonta/items/9f6273ead66351705036
var __decorate = this.__decorate || function (decorators, target, key, value) {
var kind = typeof (arguments.length == 2 ? value = target : value);
for (var i = decorators.length - 1; i >= 0; --i) {
var decorator = decorators[i];
switch (kind) {
case "function": value = decorator(value) || value; break;
case "number": decorator(target, key, value); break;
case "undefined": decorator(target, key); break;
case "object": value = decorator(target, key, value) || value; break;
}
@nana4gonta
nana4gonta / file6.txt
Last active August 29, 2015 14:18
TypeScript 1.5 Alphaに実装されたES6 modulesを試してみた ref: http://qiita.com/nana4gonta/items/2466f7ca5b3607fbfdb4
$ tsc --module commonjs --target ES6 main.ts greet.ts
error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher.
@nana4gonta
nana4gonta / Gruntfile.js
Created December 19, 2014 15:09
Unix環境で作ったTypeScriptプロジェクトをVisual Studioでも有効に利用する ref: http://qiita.com/nana4gonta/items/932c448fcfb89deb8438
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
typescript: {
main: {
src: ['src/ts/**/*.ts'],
dest: 'app/js/main.js',
@nana4gonta
nana4gonta / Rakefile
Created December 1, 2014 09:36
Rakeを使ってCapybaraのドライバを切り替える ref: http://qiita.com/nana4gonta/items/5cc2afd5279ed5a5d73b
require 'rspec/core/rake_task'
namespace :mytest do
begin
[:selenium, :poltergeist].each do |target|
RSpec::Core::RakeTask.new(target) do |spec|
ENV['TARGET'] = target.to_s
spec.pattern = 'spec/**/*_spec.rb'
spec.rspec_opts = ['-c', '-f d']
end
@nana4gonta
nana4gonta / index.html
Last active August 29, 2015 14:06
KnockoutJSでリストの絞り込みとテキストのハイライトを行う ref: http://qiita.com/nana4gonta/items/ae69048772545d3081c0
<div class="content">
<label>検索:
<input type="text" class="input_highlight" data-bind="value: searchBrand, valueUpdate: 'afterkeydown'">
</label>
<ul data-bind="highlightForeach: {data: filteredBrands, search: searchBrand}">
<li>
<a data-bind="attr: {href: url}">
<span data-bind="html: name"></span>
<span data-bind="html: alias"></span>
"{\"iine_up\":\"sticky-0\"}"
"{\"id\":\"sticky-0\",\"ui_id\":\"\",\"parent\":null,\"type\":\"sticky\",\"iine\":0,\"point\":{\"x\":149,\"y\":150},\"text\":\"aaaa\"}"
@nana4gonta
nana4gonta / gist:1385914
Created November 22, 2011 15:21
RubyでTwitter OAuth
require 'openssl'
require 'uri'
require 'net/http'
require 'rubygems'
require 'twitter'
class OAuthAccessToken
def initialize(consumer_key, consumer_secret)
@request_token_uri = 'http://twitter.com/oauth/request_token'