Skip to content

Instantly share code, notes, and snippets.

View alloy's full-sized avatar

Eloy Durán alloy

View GitHub Profile
#import <Foundation/Foundation.h>
#import <libkern/OSAtomic.h>
@interface NSArray (ConcurrentMap)
- (NSArray*)semaphore_map:(id (^)(id))block;
- (NSArray*)serial_map:(id (^)(id))block;
- (NSArray*)spinlock_map:(id (^)(id))block;
- (NSArray*)direct_map:(id (^)(id))block;
@end
@alloy
alloy / STFU_UIAccessibilityLoader.m
Last active October 17, 2021 04:31
(If you too like to live dangerously) this will get rid of the following error message when running on the iOS Simulator: `Cannot find executable for CFBundle <CertUIFramework.axbundle>`
// When the `accessibility inspector' is enabled on the iOS Simulator the private `UIAccessibility'
// framework is loaded. In turn it will try to load a list of bundles amongst which is one that has
// only resources, no executable. This leads to `CFBundleLoadExecutableAndReturnError' logging this
// offending error message.
//
// This code omits the `SDK_ROOT/System/Library/AccessibilityBundles/CertUIFramework.axbundle'
// bundle from ever being attempted to load.
//
// This code is available under the MIT license: http://opensource.org/licenses/MIT
//
@alloy
alloy / DEA-providers.rb
Created May 24, 2012 09:47
List of ‘disposable email address’-provider hostnames. Collected from http://bit.ly/Jt6FZU & http://bit.ly/JKNcYC.
[".e4ward.com",
".mailexpire.com",
".otherinbox.com",
"0815.ru",
"0clickemail.com",
"0wnd.net",
"0wnd.org",
"10minutemail.com",
"20minutemail.com",
"2prong.com",

First grep the heroku logs for the message that will state that the debugger service has started:

$ heroku logs -t --app=[APP_ID] | grep 'Debugger listening on'

Then in another shell enable the debugger service of the Node process by connecting through SSH and sending the process SIGUSR1:

$ heroku ps:exec --app=[APP_ID]
@alloy
alloy / Results
Last active April 30, 2021 11:34
RSpec boot times vs smaller test frameworks.
~/t/rspec-vs-small » ruby -v
ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-darwin12.2.0]
~/t/rspec-vs-small » gem install rspec peck bacon
Successfully installed rspec-2.14.1
Successfully installed peck-0.3.0
Successfully installed bacon-1.2.0
3 gems installed
~/t/rspec-vs-small » ruby time.rb

Peeps

  • Manfred Stienstra
  • Eloy Durán
  • Andrei Bocan
  • Christoph Sturm
  • Markus Prinz
  • Mislav Marohnić
  • Ivana ‘Marohnić’
  • Nicolás Sanguinetti
When he’s not sorting coloured LEDs, soldering DIY synthesisers,
or sharing/forcing his extensive hands-on ‘X design’/browser experience
knowledge with/on the twittersphere, he leads a small app consultancy
shop known for their continuous striving for doing things well.
@alloy
alloy / LiveQueryPolyfill.ts
Last active February 24, 2021 15:09
Rewrite GraphQL Live Query to subscription.
/**
* This is a Live Query polyfill, as graphql-js does not strictly have support for that. Instead, we leave it up to the
* client to recognize a Live Query is requested with the `@live` directive on a `query` operation and here we
* transform it into a `live` subscription instead.
*
* Consider a schema like the following:
*
* ```graphql
type Badge {
id: ID!
scalar Date
type Query {
badge: Badge!
}
type Badge {
key: BadgeKey!
text: String!
history: BadgeHistoryConnection!
[
"Apps/Artist/ArtistApp.tsx",
"Apps/Artist/Components/ArtistCollectionsRail/ArtistCollectionEntity.tsx",
"Apps/Artist/Components/ArtistCollectionsRail/ArtistCollectionsRail.tsx",
"Apps/Artist/Components/ArtistCollectionsRail/__tests__/ArtistCollectionEntity.test.tsx",
"Apps/Artist/Components/ArtistCollectionsRail/__tests__/ArtistCollectionsRail.test.tsx",
"Apps/Artist/Components/ArtistCollectionsRail/index.tsx",
"Apps/Artist/Components/ArtistConsignButton.tsx",
"Apps/Artist/Components/ArtistHeader.tsx",
"Apps/Artist/Components/ArtistIndicator.tsx",