Skip to content

Instantly share code, notes, and snippets.

View vibze's full-sized avatar

Viktor Ten vibze

  • Almaty, Kazakhstan
View GitHub Profile
@vibze
vibze / .DS_Store
Last active September 30, 2019 07:41
Постановка задачи
@vibze
vibze / RegistrationFlow.swift
Created August 18, 2017 05:17
Flow example
import Foundation
class RegistrationFlow: Flow {
let phoneNumber: String
var registerToken: String
var navigationController: UINavigationController?
var completion: (() -> Void)?
/**
Примеры возможных урлов
darplay://video/content?id=xxx&type=video&autoplay=1 <- Автопроигрывание видео
darplay://video/content?id=xxx&type=compilation&video_id=xxx&autoplay=1 <- Автопроигрывание второго сезона, третьей серии
darplay://video/selection?id=xxx
darplay://music/selection?id=xxx
darplay://music/album?id=xxx
darplay://music/artist?id=xxx
@vibze
vibze / UIApplication+topViewController.swift
Created November 9, 2016 17:08
UIApplication extension for pulling a topViewController
import Foundation
import UIKit
extension UIApplication {
class func topViewController(base: UIViewController? = UIApplication.shared.keyWindow?.rootViewController) -> UIViewController? {
if let nav = base as? UINavigationController {
return topViewController(base: nav.visibleViewController)
}
if let tab = base as? UITabBarController {
@vibze
vibze / gulpfile.js
Last active December 27, 2015 11:19
Coffeescript + React + JSX + Browserify app boilerplate
var gulp = require('gulp');
var gutil = require('gulp-util');
var cjsx = require('gulp-cjsx');
var browserify = require('gulp-browserify');
var rename = require('gulp-rename');
gulp.task('dist', function(){
gulp.src('./src/**/*.cjsx')
.pipe(cjsx({bare: true}).on('error', gutil.log))
.pipe(gulp.dest('./dist/'))
@vibze
vibze / BY8001.cpp
Created November 20, 2015 18:00
Arduino Buttons
// BY8001.cpp, BY8001 Mp3 Player Function Library
// Date: June 2015
// Author: borland of Arduino forum
// No affiliation with Balway Electronics Technology or Shenzhen Electronics Technology Ltd.
// Released in public domain
#include "Arduino.h"
#include "BY8001.h"
BY8001::BY8001() {
@vibze
vibze / gist:3881005
Created October 12, 2012 19:28
Ruby date format tokens reference
%a - The abbreviated weekday name (``Sun'')
%A - The full weekday name (``Sunday'')
%b - The abbreviated month name (``Jan'')
%B - The full month name (``January'')
%c - The preferred local date and time representation
%d - Day of the month (01..31)
%H - Hour of the day, 24-hour clock (00..23)
%I - Hour of the day, 12-hour clock (01..12)
%j - Day of the year (001..366)
%m - Month of the year (01..12)
gem_group :development, :test do
gem "rspec-rails"
end
gem_group :test do
gem "factory_girl_rails"
gem "capybara"
gem "guard-rspec"
end
LayoutInflater inflator = context.getLayoutInflater();