spec
|--- apis #do not put into controllers folder.
|--- your_api_test_spec.rb
|--- controllers
|--- models
|--- factories
|--- views
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.
Using the Github Archive API, create a command-line tool to find popular repos to add lots of hipster acronyms to your resume!
It should support a date range in the past in case time travel becomes possible and you decide to go back and learn different things.
You should use Ruby or Javascript based on the role you are being considered for.
Given the date range, you'll collect event data from the Github Archive and give each repo a popularity score.
Please post your answers to a JSBin within a week of receiving this test. Feel free to use whichever compiled-to-JS language you want (Coffeescript, ES6/Babel, vanilla Javascript, etc..), but be prepared to explain what your code compiles down to in plain ol' Javascript if you do.
- Create a Vehicle class with
getName
andsetName
methods which manipulate aname
property on its class instances. - Write a getter/setter for
wheels
andseats
using the get/set keywords if your language of choice supports them (pro-tip: it probably does). - Create Car and Motorcycle classes which extend from Vehicle and set the number of seats/wheels appropriately.
- Instances should be properly inherit from your class, so
myCarInstance instanceof Car
should returntrue
.
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
https://blog.frd.mn/install-nginx-php-fpm-mysql-and-phpmyadmin-on-os-x-mavericks-using-homebrew/
Install: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
If installed already: brew update && brew upgrade
let isAlreadyFetchingAccessToken = false | |
let subscribers = [] | |
function onAccessTokenFetched(access_token) { | |
subscribers = subscribers.filter(callback => callback(access_token)) | |
} | |
function addSubscriber(callback) { | |
subscribers.push(callback) | |
} |