Skip to content

Instantly share code, notes, and snippets.

@denisnazarov
denisnazarov / keybase.md
Last active December 9, 2017 20:55
keybase.md

Keybase proof

I hereby claim:

  • I am denisnazarov on github.
  • I am denisnazarov (https://keybase.io/denisnazarov) on keybase.
  • I have a public key ASAvY_a5R4ftjZZ8OO1JRHzg-4ul3TOrz8PIFYrk-_qFgwo

To claim this, I am signing this object:

@denisnazarov
denisnazarov / mvvm
Last active July 24, 2017 12:51
iOS ReactiveCocoa/MVVM Resources
## Collection of posts/videos I've found useful while researching mvvm
https://speakerdeck.com/jspahrsummers/code-reuse-with-mvvm
http://cocoasamurai.blogspot.com/2013/03/basic-mvvm-with-reactivecocoa.html
http://www.teehanlax.com/blog/model-view-viewmodel-for-ios/
http://martinfowler.com/eaaDev/PresentationModel.html
http://twocentstudios.com/blog/2014/06/08/on-mvvm-and-architecture-questions/
@denisnazarov
denisnazarov / video_convert.sh
Last active October 31, 2016 13:40
FFMPEG batch convert to h264 mp4 and webm
#! /bin/bash
# Based on Batch Convert Script originally by Beterhans
# Put all video files need to be converted in a folder!
# the name of files must not have " " Space!
# Rename the File if contain space
# Target dir
indir=$1
// Picasso at MoMA
{
"ConstituentID": 4609,
"DisplayName": "Pablo Picasso",
"ArtistBio": "Spanish, 1881–1973",
"Nationality": "Spanish",
"Gender": "Male",
"BeginDate": 1881,
"EndDate": 1973,
@denisnazarov
denisnazarov / full-screen-video.css
Created December 24, 2013 21:24
Full screen (background) video with just CSS: http://jsbin.com/EzakOYIb/1
.full-screen-video-container{
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
}
.full-screen-video-container video{
position: absolute;
li > ul{
display: none;
}
@denisnazarov
denisnazarov / interacting_jquery.js
Created November 20, 2013 14:41
Interacting with jQuery events in Ember.js Views
// jQuery event handler in the View
didInsertElement: function () {
var self = this;
this._boundApplyResize = function(){
self.applyResize();
}
$(window).on('resize', this._boundApplyResize);
},
Application.LoadingTransitionMixin = Ember.Mixin.create
afterModel: (model, transition) ->
previousRoute = @get('router').previousRoute
if previousRoute
@get('router').previousRoute.cleanUp()
cleanUp: ->
deferredPromise = new Ember.Deferred()
@controller.set('cleanUpPromise', deferredPromise)
{{view "Application.CrossfadeVideoContainerView" url=videoUrl class="crossfade-container"}}
fade: (opacity, callback) -> | 10 if (url === this.get('currentView.src')){
11 currentOpacity = @$().css('opacity') | 11 this.get('controller.videoPromise').resolve();
12 return callback() if currentOpacity == opacity | 12 return;
13 | 13 }
14 @$().css('opacity', opacity) | 14