This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> | |
<channel> | |
<title>Example Channel</title> | |
<link>http://example.com/</link> | |
<description>My example channel</description> | |
<item> | |
<title>News#2</title> | |
<link>http://example.com/2</link> | |
<description><![CDATA[<img src="http://www.joomlaworks.net/images/demos/galleries/abstract/9.jpg"/>]]></description> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def is_credit_card_valid(n): | |
credit_card_str = str(n) | |
credit_card_as_list = map(int, credit_card_str) | |
if not re.match('^\d{1,16}$', credit_card_str): | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.overlay { | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
opacity: 0; | |
transition: all 0.35s ease; | |
-webkit-transition: all 0.35s ease; | |
-moz-transition: all 0.35s ease; | |
-o-transition: all 0.35s ease; | |
-ms-transition: all 0.35s ease; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Disclaimer: The instructions are the collective efforts from a few places online. | |
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did. | |
First off, bundle. | |
================== | |
1. cd to the project directory | |
2. Start the react-native packager if not started | |
3. Download the bundle to the asset folder: | |
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isMobile() { | |
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); | |
} |
Задание
Реализовать на Ruby с использованием Rails приложение со следующим функционалом:
- Регистрация / авторизация пользователей.
- Создание портфеля акций (5-6 акций достаточно) для пользователя: стандартный CRUD.
- Данные должны скачиваться с Yahoo Finance.
- Сделать вывод графика "стоимость портфеля от времени" за 2 последних года по выбранным в п.2 акциям.
Требования
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Imagine that you are writing a Ruby/Rails application that must consume a third party RESTful API. | |
If the API is receiving too many requests from the application then it will return HTTP status code 429. | |
In this case the Rails application should wait 15 seconds and then re-submit the same request to the API. | |
Please demonstrate how you would test this behavior using RSpec. The test should be as simple as possible. | |
- You have an array of ints. Integers from 1 to j successively. 2 elements are missing. | |
Create an algorithm to find this numbers. | |
- You have an array of ints. Create function which groups numbers by sum of pairs | |
pairAmount = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A script to set up a new mac. Uses bash, homebrew, etc. | |
# Focused for ruby/rails development. Includes many utilities and apps: | |
# - homebrew, rvm, node | |
# - quicklook plugins, terminal fonts | |
# - browsers: chrome, firefox | |
# - dev: iterm2, sublime text, postgres, chrome devtools, etc. | |
# - team: slack, dropbox, google drive, skype, etc |
Create an .htaccess file in the webroot:
AuthUserFile /app/www/.htpasswd
AuthType Basic
AuthName "Restricted Access"
Require valid-user
Create a .htpasswd file:
htpasswd -c /app/www/.htpasswd [username]
OlderNewer