Skip to content

Instantly share code, notes, and snippets.

Aviv Ben-Yosef abyx

Block or report user

Report or block abyx

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
View cache.swift
let URLCache = NSURLCache(memoryCapacity: 4 * 1024 * 1024, diskCapacity: 25 * 1024 * 1024, diskPath: nil)
View evernote_exporter.applescript
do shell script "open -a /Applications/"
delay 10 # Evernote is slooooooow
with timeout of (10 * 60) seconds
tell application "Evernote"
set allnotebooks to notebooks
repeat with anotebook in allnotebooks
set aname to name of anotebook
abyx / angular-error-handling.js
Last active May 16, 2019
AngularJS HTTP Error Handling Mechanism
View angular-error-handling.js
var HEADER_NAME = 'MyApp-Handle-Errors-Generically';
var specificallyHandleInProgress = false;
angular.module('myApp').factory('RequestsErrorHandler', ['$q', function($q) {
return {
// --- The user's API for claiming responsiblity for requests ---
specificallyHandled: function(specificallyHandledBlock) {
specificallyHandleInProgress = true;
try {
return specificallyHandledBlock();
abyx / Board.lua
Created Jun 7, 2012
Game of Life in Codea | Video available here
View Board.lua
Board = class()
function Board:init(size)
self.grid = {}
for i = 1, size do
self.grid[i] = {}
for j = 1, size do
self.grid[i][j] = false
public void betterTest() throws Exception {
// Do some setup
// ...
final Exchanger<Exception> exchanger = new Exchanger<Exception>();
new Thread() {
public void run() {
Exception thrown = null;
View build.xml
<target name="compile" depends="compile-grammar">
<javac srcdir="${src}" destdir="${build}">
<classpath refid="classpath.base"/>
<target name="compile-grammar" depends="-check_grammar_needs_compile"
<java classname="org.antlr.Tool" failonerror="true">
<arg value="${grammar-file}"/>
abyx / gol.rb
Created Jan 31, 2012
Final exercise at Corey Haines' Improving Your TDD workshop
View gol.rb
class Board
def initialize
@living = []
def evolve_dead_cells
def add_living_cell(location)
View gist:1392238
# When doing this:
class SomeError < Exception
def initialize(some, args); end
describe 'bad message' do
it 'raises an exception' do
obj = stub
View const_lookup.rb
Object.const_defined? :Integer
#=> true
You can’t perform that action at this time.