Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| def msort[T](xs: List[T])(implicit ord: Ordering[T]): List[T] = { | |
| val n = xs.length / 2 | |
| if (n == 0) xs | |
| else { | |
| def merge(xs: List[T], ys: List[T]) : List[T] = { | |
| (xs, ys) match { | |
| case (Nil, ys) => ys | |
| case (xs, Nil) => xs | |
| case (x :: xs1, y :: ys1) => { | |
| if (ord.lt(x, y)) x :: merge(xs1, ys) |
| apply plugin: 'java' | |
| apply plugin: 'scala' | |
| // For those using Eclipse or IntelliJ IDEA | |
| apply plugin: 'eclipse' | |
| apply plugin: 'idea' | |
| def findPlay20(){ | |
| def pathEnvName = ['PATH', 'Path'].find{ System.getenv()[it] != null } | |
| for(path in System.getenv()[pathEnvName].split(File.pathSeparator)){ | |
| for(playExec in ['play.bat', 'play.sh', 'play']){ |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.
The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.
When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].
When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.
By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:
/people/6
But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| 1. Event delegation | |
| We have html code: | |
| <ul id="todo-app"> | |
| <li class="item">Walk the dog</li> | |
| <li class="item">Pay bills</li> | |
| <li class="item">Make dinner</li> | |
| <li class="item">Code for one hour</li> | |
| </ul> |
| # Add the "https://github.com/jwt/ruby-jwt" gem to your "Gemfile" | |
| gem 'jwt' |
| # lib/omniauth/facebook.rb | |
| require 'httparty' | |
| module Omniauth | |
| class Facebook | |
| include HTTParty | |
| # The base uri for facebook graph API | |
| base_uri 'https://graph.facebook.com/v2.3' |
| #!/usr/bin/env ruby | |
| require 'open-uri' | |
| require 'JSON' | |
| require 'digest/sha2' | |
| require 'pry' | |
| require 'bigdecimal' | |
| require 'bitcoin' # Because I need to cheat every now and then | |
| # Usage: | |
| # gem install pry json ffi ruby-bitcoin |