Skip to content

Instantly share code, notes, and snippets.

View evadne's full-sized avatar
🎣
gone fishing

Evadne Wu evadne

🎣
gone fishing
View GitHub Profile
@evadne
evadne / About.md
Last active April 9, 2024 07:19
Create display override file to force Mac OS X to use RGB mode for Display.

Create display override file to force Mac OS X to use RGB mode for Display.

  • Dell (4268) = 0x40ac
  • U3011 (16485) = 0x4065: /System/Library/Displays/Overrides/DisplayVendorID-10ac/DisplayProductID-4065
  • U2713HM (16512) = 0x4080: /System/Library/Displays/Overrides/DisplayVendorID-10ac/DisplayProductID-4080

Credit: http://embdev.net/topic/284710; works for OS X 10.8 & last tested on 10.9 13A476u.

Open Source Is Not A Warzone. Not Every Man Is A Dick.
We are women of tech. We do Open Source. We are part of Open Source
communities.
We attend tech conferences, usergroups and hackathons along with our
fellow male developers.
And we like it.
@evadne
evadne / gist:5596987
Created May 17, 2013 04:49
Correctly Handling ACErrorAccountNotFound
ACAccountStore * const accountStore = [ACAccountStore new];
ACAccountType * const accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
[accountStore requestAccessToAccountsWithType:accountType options:@{
ACFacebookAppIdKey: @"-snip-"
} completion:^(BOOL granted, NSError *error) {
if (!granted) {
switch (error.code) {
case ACErrorAccountNotFound: {
dispatch_async(dispatch_get_main_queue(), ^{
@evadne
evadne / index.html
Created May 8, 2013 01:58
According (Single Visible Flex Stack)
<html>
<head>
<meta charset="UTF-8">
<title>Accordion Test</title>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
}
body {
@evadne
evadne / index.html
Created May 7, 2013 22:52
Accordion (Stacked Flex-Box Panels)
<html>
<head>
<meta charset="UTF-8">
<title>Accordion Test</title>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
}
body {
@evadne
evadne / index.html
Last active December 17, 2015 01:58
Accordion
<html>
<head>
<meta charset="UTF-8">
<title>Accordion Test</title>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
}
body {
@evadne
evadne / gist:5519337
Last active May 17, 2016 09:05
Loading Custom Fonts with CTFontManager
CTFontManagerRegisterFontsForURLs((__bridge CFArrayRef)((^{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *resourceURL = [[NSBundle mainBundle] resourceURL];
NSArray *resourceURLs = [fileManager contentsOfDirectoryAtURL:resourceURL includingPropertiesForKeys:nil options:0 error:nil];
return [resourceURLs filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSURL *url, NSDictionary *bindings) {
CFStringRef pathExtension = (__bridge CFStringRef)[url pathExtension];
NSArray *allIdentifiers = (__bridge_transfer NSArray *)UTTypeCreateAllIdentifiersForTag(kUTTagClassFilenameExtension, pathExtension, CFSTR("public.font"));
if (![allIdentifiers count]) {
return NO;
}
@evadne
evadne / index.html
Created May 4, 2013 21:26
Sticky HTML Header
<html>
<head>
<meta charset="utf=8">
<style type="text/css">
html, body {
margin: 0;
padding: 0;
}
body {
max-width: 1024px;
@evadne
evadne / gist:5485195
Created April 29, 2013 22:08
Create display override file to force Mac OS X to use RGB mode for Display
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -r -c AppleDisplay`
edid_hex=data.match(/IODisplayEDID.*?<([a-z0-9]+)>/i)[1]
vendorid=data.match(/DisplayVendorID.*?([0-9]+)/i)[1].to_i
@evadne
evadne / gist:5457783
Created April 25, 2013 05:53
Dump Polygons from the Geometry Control sample from Google (with v2 JavaScript API)
// use on the geometry control
function getVertices (polygon) {
var answer = [];
for (var i = 0, I = polygon.getVertexCount(); i < I; ++i) {
var xy = polygon.getVertex(i);
answer.push([xy.lat(), xy.lng()]);
}
return answer;
}