Skip to content

Instantly share code, notes, and snippets.

View negabaro's full-sized avatar

kim negabaro

View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@joaoneto
joaoneto / login.test.js
Created March 13, 2013 13:49
Login session test with mocha
var request = require('supertest'),
should = require('should'),
app = require('../server');
var Cookies;
describe('Functional Test <Sessions>:', function () {
it('should create user session for valid user', function (done) {
request(app)
.post('/v1/sessions')
@yatemmma
yatemmma / git-lesson.md
Last active February 15, 2022 03:36
git初心者への道 - お仕事で困らないレベルまでググっとします。

git初心者への道

まずやってみよう - コミットする、ログを見る、差分を見る

初登場するコマンド: init, add, commit, log, config, status, diff

@mugyu
mugyu / vimscript_debug.vim
Created June 1, 2014 22:37
vimscript の デバッグをする時のあれやこれや
#
# Learn Vimscript the Hard Way - Echoing Messages
# http://learnvimscriptthehardway.stevelosh.com/chapters/01.html
#
echomsg string(obj)
:message
"
@omarstreak
omarstreak / background.js
Last active October 22, 2023 15:44
Chrome API Extension
//oauth2 auth
chrome.identity.getAuthToken(
{'interactive': true},
function(){
//load Google's javascript client libraries
window.gapi_onload = authorize;
loadScript('https://apis.google.com/js/client.js');
}
);
@k33g
k33g / index.html
Last active April 18, 2019 05:49
Vue.js + ES6
<div id="demo">
<h1>{{bob.fields.firstName}} {{bob.fields.lastName}}</h1>
</div>
<ul id="humans-list">
<li v-repeat="humans">
{{fields.firstName}} {{fields.lastName}}
</li>
</ul>
@johnbintz
johnbintz / simple-capistrano-docker-deploy.rb
Last active April 3, 2023 08:23
Simple Capistrano deploy for a Docker-managed app
# be sure to comment out the require 'capistrano/deploy' line in your Capfile!
# config valid only for Capistrano 3.1
lock '3.2.1'
set :application, 'my-cool-application'
# the base docker repo reference
set :name, "johns-stuff/#{fetch(:application)}"
@hartzis
hartzis / ImageUploadComponent.jsx
Last active April 3, 2023 18:09
React Image Upload with Preview
// https://codepen.io/hartzis/pen/VvNGZP
class ImageUpload extends Component {
constructor(props) {
super(props);
this.state = {
file: '',
imagePreviewUrl: ''
};
this._handleImageChange = this._handleImageChange.bind(this);
this._handleSubmit = this._handleSubmit.bind(this);
@blueplanet
blueplanet / file0.rb
Created August 13, 2015 10:59
routeのmoduleとnamespaceとscopeの違い ref: http://qiita.com/blueplanet/items/522cc8364f6cf189ecad
namespace :admin do
resources :users
end
# rake routes
Prefix Verb URI Pattern Controller#Action
admin_users GET /admin/users(.:format) admin/users#index
POST /admin/users(.:format) admin/users#create
new_admin_user GET /admin/users/new(.:format) admin/users#new
dit_admin_user GET /admin/users/:id/edit(.:format) admin/users#edit
@shallwefootball
shallwefootball / custom_element.md
Last active March 25, 2019 08:34
custom element

Custom Element

Custom Elements를 사용해야 하는 이유

커스텀엘리먼트는 개발자가 인터페이스로 정의하는 플랫폼 객체이다. 이것을 custom element prototype이라 부른다.(w3c spec)

모든 웹 개발자들이 새로운 타입의 HTML element를 정의하는 것.

  1. 새 HTML/DOM element 정의하기