Skip to content

Instantly share code, notes, and snippets.

View superhard's full-sized avatar
🎯
Focusing

Artem superhard

🎯
Focusing
View GitHub Profile
@iamjason
iamjason / UIImage+Tinting.swift
Last active December 10, 2019 21:59
Swift UIImage extension for tinting images
/**
Usage:
let originalImage = UIImage(named: "cat")
let tintedImage = originalImage.tintWithColor(UIColor(red: 0.9, green: 0.7, blue: 0.4, alpha: 1.0))
*/
extension UIImage {
func tintWithColor(color:UIColor)->UIImage {
86937 isset
43159 echo
31697 empty
29252 substr
26146 count
24248 is_array
22572 strlen
19365 sprintf
18090 unset
16584 str_replace
@0oneo
0oneo / UIScrollView with masonry
Last active October 12, 2017 12:38
vertical and Horizontal scrollview using masonry
@interface ViewController ()
@property (strong, nonatomic) UIScrollView* vScrollView;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
@calebd
calebd / AsynchronousOperation.swift
Last active February 27, 2025 09:17
Concurrent NSOperation in Swift
import Foundation
/// An abstract class that makes building simple asynchronous operations easy.
/// Subclasses must implement `execute()` to perform any work and call
/// `finish()` when they are done. All `NSOperation` work will be handled
/// automatically.
open class AsynchronousOperation: Operation {
// MARK: - Properties
@netpoetica
netpoetica / ios-select-fix.css
Last active April 10, 2025 19:00
iOS Disable User Select but Allow Input (Snippet)
/*
This is for demonstration purposes. Ideally, you should never use the star selector.
I recommend that you use this early on in your development, and then once you've established
your HTML element palette, go back and replace * with a comma-separated list of your
tag names. Additionally, the !important shouldn't have to be used, but I'm leaving it here
because some enterprising goons will probably copy and paste this directly into their project -
the !important will ensure these settings override other attempts that were either never
deleted or are part of an installed CSS file the user is unaware of.
*/
* {
@arturlector
arturlector / ios-test-task-1.md
Last active October 26, 2018 13:08
Тестовое задание на позицию iOS-разработчика в Flatstack

Написать простой клиент для VK.

Минимальные требования:

###Скрины:

  • Авторизация пользователя (Oauth 2.0). (Контроллер LoginController - содержит кнопку [Login with VK] для перехода на страницу авторизации).
  • Cписок постов: отображение постов из новостной ленты. (по желанию количество лайков и репостов). (Контроллер NewsController - появляется после авторизации пользователя, содержит список постов со следующими полями: имя пользователя, дата поста, аватар, текст поста, прикрепленная картинка: 1-2). (* Отображать видео и аудио файлы не нужно).
@sh1n0b1
sh1n0b1 / ssltest.py
Created April 8, 2014 07:53
Python Heartbleed (CVE-2014-0160) Proof of Concept
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
//
// UITextView+Placeholder.h
// DongXi
//
// Created by Gong Hao on 3/6/14.
// Copyright (c) 2014 Douban Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
@leesmith
leesmith / simple-git-workflow.md
Last active December 30, 2023 23:37
Simple Git Workflow For Continuous Delivery

Simple Git Workflow For Continuous Delivery

Workflow guidelines:

  • master branch is always production-ready, deployable, 100% green test suite
  • New development is done on feature branches, with frequent rebasing onto master
  • Clean commit history by preferring to rebase instead of merge (git pull is configured to automatically rebase)

rebase workflow

Workflow

@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active January 25, 2025 15:00
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*