Skip to content

Instantly share code, notes, and snippets.

View drinkius's full-sized avatar

Alexander Telegin drinkius

View GitHub Profile
import CoreGraphics
import Foundation
import UIKit
class GradientLabel : UILabel {
let gradient: CGGradient!
let alignedToSuperview: Bool!
@drinkius
drinkius / iOS.8.3.txt
Created December 30, 2016 22:22
iOS UIFont names
UIFont: family Thonburi
UIFont: font Thonburi-Bold
UIFont: font Thonburi
UIFont: font Thonburi-Light
UIFont: family Khmer Sangam MN
UIFont: font KhmerSangamMN
UIFont: family Snell Roundhand
UIFont: font SnellRoundhand-Black
UIFont: font SnellRoundhand-Bold
UIFont: font SnellRoundhand
@tijme
tijme / UITextViewPlaceholder.swift
Last active February 18, 2025 18:47
The correct way to implement a placeholder in a UITextView (Swift)
//
// UITextViewPlaceholder.swift
// TextViewPlaceholder
//
// Copyright (c) 2017 Tijme Gommers <tijme@finnwea.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@drinkius
drinkius / gist:7a497f25aaa54963de2c1269f77627d4
Created November 15, 2016 09:04 — forked from Tron5000/gist:7bb51318db1da86a3a78
Compressing/Decompressing UUID to 22 characters via base64
import Foundation
// Compressing and decompressing a UUID to 22 characters via base64.
// Works great as a Swift playground. These articles were helpful:
// http://blog.codinghorror.com/equipping-our-ascii-armor/
// http://69.195.124.60/~jasondoh/2013/08/14/creating-a-short-guid-in-objective-c/
let identifier = NSUUID().uuidString
let base64TailBuffer = "="
anonymous
anonymous / porndomains
Created October 8, 2016 18:13
This file has been truncated, but you can view the full file.
d,rank,ip,country
idealmilf.com,108296,78.140.130.6,Netherlands
skygals.com,415859,173.244.206.50,United States
guardomogli.com,658261,104.28.30.26,
sexy-streaming.com,117104,5.39.117.50,France
beach-porn.net,576671,173.214.250.167,United States
blackredtube.com,598818,88.208.0.196,United States
pornotom.com,449107,104.27.129.76,
pornflip.com,79500,199.101.134.20,United States
sexynakeds.com,116152,159.122.99.163,Switzerland
@drinkius
drinkius / storage.swift
Created September 26, 2016 15:15 — forked from avdyushin/storage.swift
CoreData stack for iOS 9 and iOS 10 using Swift 3
//
// Storage.swift
//
// Created by Grigory Avdyushin on 30.06.16.
// Copyright © 2016 Grigory Avdyushin. All rights reserved.
//
import UIKit
import CoreData
@avdyushin
avdyushin / storage.swift
Last active August 28, 2023 14:35
CoreData stack for iOS 9 and iOS 10 using Swift 3
//
// Storage.swift
//
// Created by Grigory Avdyushin on 30.06.16.
// Copyright © 2016 Grigory Avdyushin. All rights reserved.
//
import UIKit
import CoreData
@jamtur01
jamtur01 / ladder.md
Last active July 15, 2026 02:10
Kickstarter Engineering Ladder
@mlvea
mlvea / UIView+AutoLayout.swift
Created September 28, 2015 13:45
UIView extension to bind subview bounds to its superview
extension UIView{
func boundInside(superView: UIView){
self.translatesAutoresizingMaskIntoConstraints = false
superView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-0-[subview]-0-|", options: NSLayoutFormatOptions.DirectionLeadingToTrailing, metrics:nil, views:["subview":self]))
superView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-0-[subview]-0-|", options: NSLayoutFormatOptions.DirectionLeadingToTrailing, metrics:nil, views:["subview":self]))
}
console.log('Loading event');
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB();
exports.handler = function(event, context) {
console.log("Request received:\n", JSON.stringify(event));
console.log("Context received:\n", JSON.stringify(context));
var tableName = "OurBlogDemo";
var datetime = new Date().getTime().toString();