Skip to content

Instantly share code, notes, and snippets.

View Kentzo's full-sized avatar
🤖

Ilya Kulakov Kentzo

🤖
View GitHub Profile
@interface Sandwich: NSObject
@end
NS_SWIFT_NAME(Sandwich.Preferences)
@interface SandwichPreferences: NSObject
@end
typedef NS_ENUM(NSInteger, SandwichBreadType) {
} NS_SWIFT_NAME(SandwichPreferences.BreadType);
NS_SWIFT_NAME(RecorderControlStyle)
@interface SRRecorderControlStyle: NSObject
@end
NS_SWIFT_NAME(RecorderControlStyle.Components)
@interface SRRecorderControlStyleComponents: NSObject
@end
typedef NS_ENUM(NSUInteger, SRRecorderControlStyleComponentsAppearance)
{} NS_SWIFT_NAME(RecorderControlStyle.Components.Appearance);
var style: RecorderControlStyle?
var components: RecorderControlStyle.Components?
var appearance: RecorderControlStyle.Components.Appearance?
@interface SRRecorderControlStyle: NSObject
@end
@interface SRRecorderControlStyleComponents: NSObject
@end
typedef NS_ENUM(NSUInteger, SRRecorderControlStyleComponentsAppearance) {};
@Kentzo
Kentzo / appledocs.m
Created May 23, 2019 18:44
NS_SWIFT_NAME is recursive
@interface Sandwich: NSObject
@end
NS_SWIFT_NAME(Sandwich.Preferences)
@interface SandwichPreferences: NSObject
@end
typedef NS_ENUM(NSInteger, SandwichBreadType) {
} NS_SWIFT_NAME(SandwichPreferences.BreadType);
@Kentzo
Kentzo / dlcourse.tf
Last active October 23, 2019 02:16
Set up AWS environment for dlcourse.ai using Terraform
# See https://www.terraform.io
# ---
# Variables
# ---
# Deep Learning AMI https://aws.amazon.com/marketplace/pp/B077GCH38C
variable "ami" {
default = "ami-0656a055aec8320d6"
}
@Kentzo
Kentzo / _usage.py
Last active September 14, 2018 00:04
The deprecated extension for the warnings module
from deprecated import *
# --- Class ---
# Class can be deprecated
# -> Every instantiation, subclassing or usage as a metaclass
# will issue a warning
@deprecated
class Foo: pass
@Kentzo
Kentzo / resolve.py
Last active April 18, 2018 19:42
Resolve IP ranges of GCE, AWS and Cloudflare
#!/usr/bin/env python3
"""
Needs the requests and dnspython packages.
"""
import ipaddress
import re
import dns.resolver
import botocore.waiter
import botocore.session
session = botocore.session.get_session()
client = session.create_client('ec2')
VOLUME_ID = ... # e.g. 'vol-049df61146c4d7901'
INSTANCE_ID = ... # e.g. 'i-1234567890abcdef0'
DEVICE = ... # e.g. '/dev/xvdba'
{
"Volumes": [
{
"AvailabilityZone": "us-east-1a",
"Attachments": [
{
"AttachTime": "2013-12-18T22:35:00.000Z",
"InstanceId": "i-1234567890abcdef0",
"VolumeId": "vol-049df61146c4d7901",
"State": "attached",