This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function handleTabLinks() { | |
| var hash = window.location.href.split("#")[1]; | |
| if (hash !== undefined) { | |
| var hpieces = hash.split("/"); | |
| for (var i=0;i<hpieces.length;i++) { | |
| var domelid = hpieces[i]; | |
| var domitem = $('a[href=#' + domelid + '][data-toggle=tab]'); | |
| if (domitem.length > 0) { | |
| if (i+1 == hpieces.length) { | |
| // last piece |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
| <script type="text/javascript"> | |
| $(document).ready(function() { | |
| equalizeHeights(); | |
| } | |
| </script> | |
| <style> | |
| .box { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Executed on MacOSX | |
| go build signal.go | |
| ./signal & | |
| kill -INT $! | |
| # Prints the "interrupt" and quits after 5 seconds, which is to be expected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html ng-app="MyApplication"> | |
| <head> | |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script> | |
| <script src="timeago-angular.js" type="text/javascript"></script> | |
| <script src="my-app.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
| <div ng-controller="myController"> | |
| <span class="time-ago" title="{{ myTime }}"></span> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| language: python | |
| python: | |
| - "2.7" | |
| - "3.2" | |
| # command to run tests | |
| script: | |
| - python setup.py nosetests | |
| - ./another_script.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Can't be tested locally due to same origin policies. I used Python's | |
| SimpleHTTPServer for serving this: | |
| $ python -m SimpleHTTPServer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Modifies $httpProvider for correct server communication (POST variable format) | |
| angular.module('http-post-fix', [], function($httpProvider) { | |
| // This code is taken from http://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/ | |
| // Use x-www-form-urlencoded Content-Type | |
| $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; | |
| // Override $http service's default transformRequest | |
| $httpProvider.defaults.transformRequest = [function(data) { | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class EventId(types.BaseType): | |
| """Schema type for aggregate event id.""" | |
| DIVIDER = ':' | |
| def to_primitive(self, value): | |
| if not isinstance(value, tuple): | |
| raise ValidationError('{0} is not a tuple'.format(value)) | |
| if len(value) != 2: | |
| raise ValidationError('{0} does not have two items'.format(value)) | |
| prim = EventId.DIVIDER.join(str(v) for v in value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| sys.path.append("/home/damian/disco/lib/") | |
| from disco.core import Job, result_iterator | |
| from disco.worker.classic.func import chain_reader | |
| import csv, sys | |
| class CsvInnerJoiner(Job): | |
| partitions = 2 | |
| sort = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Map; | |
| import java.util.Set; | |
| /** | |
| * An immutable object reference that may not be null. | |
| * <p> | |
| * This class has two purposes: | |
| * <ul> | |
| * <li>it adds a clearly documents the fact that a variable must not be | |
| * <code>null</code>.</li> |