Skip to content

Instantly share code, notes, and snippets.

View justuseapen's full-sized avatar

Justus Eapen justuseapen

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')
@wannabefro
wannabefro / sublimetips.md
Created November 12, 2013 22:00
sublime stuff

Sublime Text Tips & Tricks

Command P || Command T

Press Command + T or Command + P, type in the name of the file you wish to access (fuzzy finder), and, without even pressing Enter, you’ll instantly be transported to that file.

Shift Command P

We can use Sublime’s command palette by accessing the Tools menu, or by pressing Shift + Command + P, on the Mac.

Whether you need to visit a Preferences page, or paste in a snippet, all of that can be accomplished here.

@jboursiquot
jboursiquot / authenticate_with_github_spec.rb
Created January 7, 2014 21:16
spec/features/authenticate_with_github_spec.rb
require 'spec_helper'
feature 'authenticate with github', %q{
As a user
I want to authenticate
So that I can gain access to the system
}, authentication: true,
vcr: {cassette_name: 'github/auth'} do
# Acceptance Criteria
# * if my identity exists in the system and I'm authorized, grant me access
@jboursiquot
jboursiquot / attempt.rb
Created January 7, 2014 21:18
app/models/authentication/attempt.rb
module Authentication
class Attempt
class_attribute :bypass_team_check
attr_reader :data
def initialize(auth_data, user_params = {})
@data = auth_data
@user_params = user_params
end
@jboursiquot
jboursiquot / team_check.rb
Created January 7, 2014 21:18
app/models/authentication/team_check.rb
module Authentication
class TeamCheck
include GitHub::HasClient
def initialize(token, login)
@token = token
@login = login
end
def passes?
@dwayne
dwayne / exact-center.scss
Created February 19, 2014 11:48
A mixin for horizontally and vertically centering a block element.
// http://css-tricks.com/snippets/css/exactly-center-an-imagediv-horizontally-and-vertically/
@mixin exact-center($width, $height) {
width: $width;
height: $height;
position: absolute;
left: 50%;
top: 50%;
margin-left: -$width / 2;
margin-top: -$height / 2;
}
@ericdouglas
ericdouglas / super-tip.txt
Last active October 6, 2024 18:28
Change 4 spaces to 2 spaces indentation and change tab to spaces - Vim tip
// 4 spaces to 2 spaces
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
// Tab to 2 spaces
:%s/\t/ /g
@richardgill
richardgill / normalizeStyle.js
Created December 2, 2016 16:31
Makes React Native components look more consistent on different device sizes. The base size is an iPhone 6.
import _ from 'lodash'
import { Dimensions, PixelRatio } from 'react-native'
import { platformIsIos } from 'expresso-common/common/platform'
const { height } = Dimensions.get('window')
const iphone6Height = 667
const pixelRatio = PixelRatio.get()
const fieldsToNormalize = [
'fontSize',
'lineHeight',
@aksonov
aksonov / rnrf.md
Last active August 26, 2024 12:27
Proposal for lightning talk at ReactiveConf 2017: What is RNRF (react-native-router-flux)?

What is RNRF (react-native-router-flux)?

React Native is great product but lacks for stable, intuitive and easy navigation API during many years. Every year we see new, better API: Native Navigator, ex-Navigator, NavigationExperimental, ex-Navigation, wix native navigation, airbnb native navigation, ReactNavigation...

Once I've started React Native development, in 2015, I created RNRF - simple API for easy navigation. It was clear that better navigation instruments will come later but I didn't want to change my code again and again to switch for better API. Every new major version of RNRF is based on different navigation framework and mostly preserves own API.

Another goal was to represent all navigation flow within one place in clear, human-readable way - similar to iOS Storyboards concept. This way other engineers could understand your app flow faster.

@jessejanderson
jessejanderson / macros.md
Last active October 28, 2024 00:58
Don't Write Macros (but do learn how they work)