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
from github import Github | |
from csv import DictWriter | |
# Generate on https://github.com/settings/tokens | |
TOKEN = '<REDACTED>' | |
ORG = 'lyft' | |
AUTHOR = '<github username here>' | |
g = Github(login_or_token=TOKEN) | |
org = g.get_organization(ORG) |
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
from mongoengine import Document, EmbeddedDocument, Q, ReferenceField | |
from pymongo.read_preferences import ReadPreference | |
all_models = Document.__subclasses__() | |
def referencing_models(document): | |
for model in all_models: | |
if issubclass(model, EmbeddedDocument): | |
continue | |
fields = [field for field in get_reference_fields_of_model(model) |
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/sh | |
set -e | |
# Converts a Quicktime movie to a GIF aniamtion. | |
# Useful for screen recordings. | |
# Preliminary step with palette required to make it look good | |
# without dithering artifacts. | |
FPS=10 | |
PALETTE=$(mktemp).png |
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
<?xml version="1.0"?> | |
<root> | |
<!-- | |
Based on: | |
https://blog.yorkxin.org/posts/2014/04/12/microsoft-sculpt-mobile-mouse-and-mac/ | |
Button 4 is the side button (located by the blue Windows button). | |
This allows you to map the Windows button as Button 5. | |
1. brew cask install karabiner |
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/sh -e | |
# Converts a Quicktime movie to a GIF aniamtion. | |
# Useful for screen recordings. | |
# Preliminary step with palette required to make it look good | |
# without dithering artifacts. | |
FPS=10 | |
PALETTE=$(mktemp).png | |
MOV=$1 |
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
''' | |
INSTALLING | |
curl --create-dirs -o ~/.lldb/cfdata.py https://gist.githubusercontent.com/ikonst/364af37c44e5f549b722/raw/cfdata.py \ | |
&& echo 'command script import ~/.lldb/cfdata.py' >> ~/.lldbinit | |
USING | |
(lldb) cfdata_save some_cfdata /Users/john/foo | |
(lldb) cfdata_save some_nsdata /Users/john/bar |
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
// Prints rainbow-colored text into the Xcode output window. | |
// Required the XcodeColors plugin: | |
// https://github.com/robbiehanson/XcodeColors | |
void XcodeRainbowLog(const char *str) | |
{ | |
float hueStep = 1.0 / strlen(str); | |
float hue = 0.0; | |
for (char *c = str; *c != '\0'; ++c) { | |
UIColor *color = [UIColor colorWithHue:hue saturation:1 brightness:0.8 alpha:1]; | |
hue += hueStep; |
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
#include <stdlib.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <pthread.h> | |
#include <sys/time.h> | |
#include <sys/errno.h> | |
struct thread_data { | |
pthread_cond_t cond; | |
int finished; |
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 Foundation; | |
@interface NSMutableAttributedString (FontWithFamily) | |
// Modifies the attributed text to change the font family while keeping | |
// font size and traits. | |
- (void)setFontFamily:(NSString *)fontFamily inRange:(NSRange)range; | |
- (void)setFontFamily:(NSString *)fontFamily; | |
@end |
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 Foundation; | |
#include <gst/gst.h> | |
@interface NSData (GStreamer) | |
- (GstBuffer *)gstBuffer; | |
@end | |
@interface NSMutableData (GStreamer) |