Skip to content

Instantly share code, notes, and snippets.

View NewGyu's full-sized avatar

NewGyu NewGyu

View GitHub Profile
@NewGyu
NewGyu / ExampleSpec.js
Created September 11, 2014 11:51
spyOn in gulp-jasmine
var str1 = new String();
var str2 = new String('123aa')
describe('example',function() {
it('use spy',function(){
spyOn(str1,'indexOf').andCallFake(function(s){
return 50;
});
expect(str1.indexOf('aa')).toEqual(50);
});
FROM centos:latest
RUN yum update -y
RUN yum install -y passwd openssh openssh-server openssh-clients sudo
## Create user
RUN useradd vagrant
RUN passwd -f -u vagrant
## Set up SSH
RUN mkdir -p /home/vagrant/.ssh; chown vagrant /home/vagrant/.ssh; chmod 700 /home/vagrant/.ssh
ADD authorized_keys /home/vagrant/.ssh/authorized_keys
@NewGyu
NewGyu / file1.txt
Created June 11, 2014 16:10
capistrano3でssh agent forwarding ref: http://qiita.com/NewGyu/items/285d6d5152e01f0b9497
$ ssh-add -l
2048 f7:07:18:66:97:f0:8f:7b:40:6f:0b:97:98:de:5e:18 /home/newgyu/.ssh/y.pem (RSA)
@NewGyu
NewGyu / Capfile
Created June 11, 2014 15:29
Capistrano3のデプロイ対象のRoleをEC2のタグで指定する ref: http://qiita.com/NewGyu/items/01b085cea4230c7dc3ab
require 'aws-sdk'
require 'capistrano/ec2_tagged'
@NewGyu
NewGyu / Capfile
Created June 11, 2014 15:15
Capistrano3でAWS EC2インスタンスにタグ付けする ref: http://qiita.com/NewGyu/items/bb5c90d45d7f4a2b811f
require 'aws-sdk'
@NewGyu
NewGyu / deploy.rb
Created June 11, 2014 14:57
capistrano3でcomposer installするときにwithinで指定したディレクトリが無視されてる ref: http://qiita.com/NewGyu/items/c793ea01f448580c580b
:
SSHKit.config.command_map[:composer] = "#{fetch(:deploy_to)}/console/composer.phar"
namespace :deploy do
:
desc 'pubilshされたあとにゴニョゴニョ'
task :published do
on roles(:console) do
@NewGyu
NewGyu / bk.js
Last active September 30, 2015 15:29
Chromeエクステンションでcontentの情報を取得する ref: http://qiita.com/NewGyu/items/8878ebc392803b0b1cd0
var issues = {};
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse){
chrome.pageAction.show(sender.tab.id);
issues[sender.tab.id] = request.issues;
sendResponse({tabid:sender.tab.id});
});
@NewGyu
NewGyu / DOS窓で
Created November 10, 2013 16:46
CygwinとKarma+PhantomJSの相性がイマイチ ref: http://qiita.com/NewGyu/items/6d8bb16ebd5b43c8b034
> npm install -g phantomjs@1.9.2-1
> npm install -g karma