Skip to content

Instantly share code, notes, and snippets.

<?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>
@gEndelf
gEndelf / cc_validation.py
Created January 7, 2016 10:16
anlgorithm for credit card validation
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
.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;
@gEndelf
gEndelf / react.md
Last active October 16, 2017 14:16
react docs:
@gEndelf
gEndelf / gist:12b90922513a77d4651c22f81f426cf3
Created August 7, 2016 10:57 — forked from marty-wang/gist:5a71e9d0a6a2c6d6263c
Compile and deploy React Native Android app of Release version to device.
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"
function isMobile() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}
@gEndelf
gEndelf / Ruby_finance_testcase.md
Last active October 19, 2016 11:03 — forked from beshkenadze/Ruby_finance_testcase.md
Тестовое задание для Ruby-разработчика

Задание

Реализовать на Ruby с использованием Rails приложение со следующим функционалом:

  1. Регистрация / авторизация пользователей.
  2. Создание портфеля акций (5-6 акций достаточно) для пользователя: стандартный CRUD.
  3. Данные должны скачиваться с Yahoo Finance.
  4. Сделать вывод графика "стоимость портфеля от времени" за 2 последних года по выбранным в п.2 акциям.

Требования

- 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
@gEndelf
gEndelf / osx-setup.sh
Created February 10, 2017 21:45 — forked from somebox/osx-setup.sh
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/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
@gEndelf
gEndelf / heroku-htaccess.md
Created May 2, 2017 04:09 — forked from bbrewer97202/heroku-htaccess.md
Simple htaccess authentication on Heroku with cedar/php

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]