Skip to content

Instantly share code, notes, and snippets.

View yavor-atanasov's full-sized avatar

Yavor Atanasov yavor-atanasov

View GitHub Profile
@yavor-atanasov
yavor-atanasov / iceland_checklist.md
Last active August 27, 2019 13:10
Iceland checklist

Bike clothing:

  • 2 pairs of bibs (keeping as clean as possible)
  • 2 short-sleeve thermal jerseys
  • 2 base layers (1 thermal, 1 windproof)
  • 2 pairs of socks
  • Arm warmers
  • Leg warmers
  • Waterproof/windproof light jacket
  • Neckwear/scarf
  • Waterproof gloves
import random as r
a = [
["Yavor Atanasov", "Steve Birks", "Paul Clifford", "Ashley Davis", "Tom Cartwright"],
["Richard Close", "Nawaid Shamim", "Pawel Bartoszek", "Daniel Harper"],
["Russell Thom", "Tom Petty", "Umesh Telang", "Alistair Wooldrige", "Elliot Thomas"],
["Gilbert Agum", "John Shields", "Paul Merry", "Mark Gledhill", "Rachel Evans", "Giovanni Lenguito", "Andre Oosthuizen"]
]
teams = (set(), set(), set())

Keybase proof

I hereby claim:

  • I am yavor-atanasov on github.
  • I am yavor_atanasov (https://keybase.io/yavor_atanasov) on keybase.
  • I have a public key ASDMmfgMwv4ps5r5VUVWEaEb_2_53VGXljA-nZy_oCAgEQo

To claim this, I am signing this object:

@yavor-atanasov
yavor-atanasov / ecmascript-5-globals.js
Created June 15, 2011 13:18
Ecmascript 5 and globals
/*
Using the Object API to define a property on the window object (a global).
Setting the writable attribute to false makes the value immutable. Setting
configurable to false makes it impossible for people to delete or change the
attributes of that property.
*/
// If the browser supports .defineProperty
if(Object.defineProperty){
/* Usage:
* jQuery.csv()(csvtext) returns an array of arrays representing the CSV text.
* jQuery.csv("\t")(tsvtext) uses Tab as a delimiter (comma is the default)
* jQuery.csv("\t", "'")(tsvtext) uses a single quote as the quote character instead of double quotes
* jQuery.csv("\t", "'\"")(tsvtext) uses single & double quotes as the quote character
*/
;
jQuery.extend({
csv: function(delim, quote, linedelim) {
delim = typeof delim == "string" ? new RegExp( "[" + (delim || "," ) + "]" ) : typeof delim == "undefined" ? "," : delim;
@yavor-atanasov
yavor-atanasov / 1-look.js
Created April 27, 2011 11:05
CSSP look-up optimization
/*
Previous proposal (focus on the code within the hash blocks):
*/
function look() {
var cssp,
elem;
if (!document.body) {
return;
@yavor-atanasov
yavor-atanasov / example-for-michael.js
Created April 1, 2011 08:25
JS- signals priorities
var Widget = function(){
this.onshow = new Signal();
/* This listener is added with the default priority which is 0 */
this.onshow.add(this.showMe);
this.onshow.dispatch();
};
@yavor-atanasov
yavor-atanasov / 1.jquery.plugin.js
Created March 22, 2011 12:40
This is what the normal jquery plugin shell looks like
/**
This is what the normal jquery plugin looks like.
The problem with that is that jQuery is expected to be a global.
However we provide jQuery as a module and, more importantly, we do not allow it to slip into the global scope.
*/
(function($,undefined){
//this is where the plugin goes
})(jQuery);
@yavor-atanasov
yavor-atanasov / gadget.js
Created March 21, 2011 23:34
Illustrating the quirks of jQuery's trigger method when using non-DOM objects
/**
jQuery's trigger() behaves in the following way:
1. Execute all callbacks bound using the bind() method in first-in-first-out order.
2. Check for a method called ('on' + eventType) e.g. "onfoo" and execute it as well
3. Check for a method called (eventType) e.g. "foo" and execute it as well
*/
require(["jquery-1"], function($) {
var Gadget = function(){
$(this).bind('foo', function(){
@yavor-atanasov
yavor-atanasov / sample_Yavor_Atanasov.js
Created October 21, 2010 23:27
My revision of the document
// The library 'jsUtil' has a public function that compares 2 arrays, returning true if
// they're the same. Refactor it so it's more robust, performs better and is easier to maintain.
/**
@name jsUtil.arraysSame
@description Compares 2 arrays, returns true if both are comprised of the same items, in the same order
@param {Object[]} a Array to compare with
@param {Object[]} b Array to compare to
@returns {boolean} true if both contain the same items, otherwise false