Skip to content

Instantly share code, notes, and snippets.

Andrey Tarantsov andreyvit

Block or report user

Report or block andreyvit

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andreyvit
andreyvit / ObservationPlayground.swift
Last active Aug 29, 2015
Code from “In search of a clean closure-based observation API in Swift” on Apple Dev Forums
View ObservationPlayground.swift
import Foundation
func weakify<T: AnyObject>(object: T, block: (T) -> Void) -> () -> Void {
weak var weakObject = object
return {
if let strongObject = weakObject {
block(strongObject)
}
}
}
@andreyvit
andreyvit / wwdc-2014-summaries.md
Last active Aug 29, 2015
WWDC 2014 Summaries
View wwdc-2014-summaries.md

A Look Inside Presentation Controllers (228)

TODO.

A Strategy for Great Work (237)

  1. “Know a good idea when you see it”: a demo of KHTML running on a Mac, made in 2 days, helped them pick it for Safari.

  2. “Don't try to solve every problem at once”: was extracting KHTML from KDE, had no idea how it worked, just compiled one file at a time, and stubbed missing functions one at a time.

View elevators.js
{
init: function(elevators, floors) {
var DIR_UP = 1, DIR_DOWN = -1, DIR_IDLE = 0;
var FLOOR_NINF = -1, FLOOR_PINF = 1000;
var floorUpRequests = [];{
init: function(elevators, floors) {
var DIR_UP = 1, DIR_DOWN = -1, DIR_IDLE = 0;
var FLOOR_NINF = -1, FLOOR_PINF = 1000;
@andreyvit
andreyvit / raid.h
Created Aug 10, 2015
One of the finer pieces of code I have ever written
View raid.h
#ifndef _RAID_H_
#define _RAID_H_
#define RAID_LEVEL 3
#define RAID_WRITE(stat) do {int raidi; for(raidi = 0; raidi < RAID_LEVEL; ++raidi) stat;} while(0)
#define raidwr raid[raidi]
#define raidrd raid[0]
GlobalState raid[RAID_LEVEL];
View gist:10420
PLEASE ABSTAIN FROM ABSTAIN
+--1++<<<>>==<<>>
View gist:11944
package com.esko.dtl.core.typeinferencing.constructs.dtl;
import com.esko.dtl.core.ast.ArrayAccess;
import com.esko.dtl.core.typeinferencing.goals.ExpressionValueInfoGoal;
import com.esko.dtl.core.typeinferencing.goals.ValueInfoGoal;
import com.yoursway.sadr.core.ValueInfoContinuation;
import com.yoursway.sadr.engine.Continuation;
import com.yoursway.sadr.engine.ContinuationRequestorCalledToken;
import com.yoursway.sadr.engine.ContinuationScheduler;
import com.yoursway.sadr.engine.InfoKind;
View gist:13602
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: unable to execute statement; nested exception is:
java.sql.SQLException: ORA-02291: Integrit?ts-Constraint (KTPS_ALLESKLAR.ASS_TARGET_ELM_ID_2_ELM_ID) verletzt - ?bergeordneter Schl?ssel nicht gefunden
ORA-06512: in "KTPS_ALLESKLAR.PCK_RELATION", Zeile 252
ORA-06512: in "KTPS_ALLESKLAR.PCK_RELATION", Zeile 343
ORA-06512: in "KTPS_ALLESKLAR.PCK_RELATION", Zeile 319
ORA-06512: in Zeile 2
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
View gist:16399
commit 39409899d95976981cea80dc140ed2b05953fb72
Author: Andrey Tarantsov <andreyvit@gmail.com>
Date: Sun Oct 12 22:24:11 2008 +0700
Extended all backgrounds to the border of the page
diff --git a/css/yoursway.css b/css/yoursway.css
index bcc5132..565f196 100644
--- a/css/yoursway.css
+++ b/css/yoursway.css
View gist:43050
say -v Cellos "oh This is a silly song silly song silly song this is the silliest song ive ever ever heard So why keep you listening listening listening while you are supposed to work to work to work to work its because i hate my job hate my job hate my job its because i hate my job more than anything else"
View timesheet.rb
require 'date'
def print_timesheet(first, last)
last_month = nil
first.upto(last) do |cur|
if last_month != cur.mon
puts
puts Date::MONTHNAMES[cur.mon]
puts
You can’t perform that action at this time.