Skip to content

Instantly share code, notes, and snippets.

View kyzmitch's full-sized avatar

Andrei Ermoshin kyzmitch

  • Russia, Nizhny Novgorod
View GitHub Profile
@jatinganhotra
jatinganhotra / Master.h
Created November 25, 2012 18:48
Can't use forward declarations in C++ in all the following cases:
// Use it as a base class
class Master : Forward {} // compiler error!
// Use it to declare a member:
class Master {
Forward cannot_define_obj_member; // compiler error!
};
// Define functions or methods using the incomplete type
void SomeFunc1(Forward x) {} // compiler error!
@finder39
finder39 / Swift-MD5.swift
Last active March 20, 2018 13:37
Swift MD5
extension String {
func md5() -> String! {
let str = self.cStringUsingEncoding(NSUTF8StringEncoding)
let strLen = CUnsignedInt(self.lengthOfBytesUsingEncoding(NSUTF8StringEncoding))
let digestLen = Int(CC_MD5_DIGEST_LENGTH)
let result = UnsafeMutablePointer<CUnsignedChar>.alloc(digestLen)
CC_MD5(str!, strLen, result)
var hash = NSMutableString()
@steve-jansen
steve-jansen / README.md
Last active June 30, 2024 17:19
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@neilco
neilco / RSASHA1.swift
Created April 27, 2015 09:07
RSA-SHA1 signing with a PKCS#12 private key
//
// RSASHA1.swift
//
// Copyright (c) 2015 Neil Cowburn. All rights reserved.
//
// 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
// copies of the Software, and to permit persons to whom the Software is
@Koze
Koze / DynamicTypeUI.m
Last active October 10, 2018 20:57
Dynamic Type for some UI components
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// UINavigationBar title
[[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]}];
// UIBarButtonItem title
[[UIBarButtonItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont preferredFontForTextStyle:UIFontTextStyleSubheadline]}
forState:UIControlStateNormal];
// UITabBarItem title
[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName: [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1]}
forState:UIControlStateNormal];
@l1x
l1x / install_gradle_version_with_homebrew.sh
Created June 17, 2015 19:24
Installing a specific version of Gradle with Homebrew
brew tap homebrew/versions
brew search gradle
brew install homebrew/versions/gradle112
gradle -version
brew link --overwrite gradle112
gradle -version
@nlutsenko
nlutsenko / yolo.sh
Last active July 22, 2024 05:12
Fast Xcode builds
defaults write xcodebuild PBXNumberOfParallelBuildSubtasks 4
defaults write xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4
defaults write com.apple.xcode PBXNumberOfParallelBuildSubtasks 4
defaults write com.apple.xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4
@CTurt
CTurt / gist:27fe7f3c241f69be19e5
Created December 14, 2015 19:24
PS4 kernel exploit tease (root FS dump, and list of PIDs)
[+] Entered shellcode
[+] UID: 0, GID: 0
[DIR]: .
[DIR]: ..
[DIR]: adm
[DIR]: app_tmp
[DIR]: data
[DIR]: dev
[DIR]: eap_user
[DIR]: eap_vsh
@steipete
steipete / SpinlockTestTests.swift
Last active August 29, 2023 08:47 — forked from RomanTruba/Synchronization_test_iOS_SDK10
Updated for Xcode 8, Swift 3; added os_unfair_lock
//
// SpinlockTestTests.swift
// SpinlockTestTests
//
// Created by Peter Steinberger on 04/10/2016.
// Copyright © 2016 PSPDFKit GmbH. All rights reserved.
//
import XCTest
@kharrison
kharrison / CoreDataController.swift
Last active January 31, 2023 22:36
Swift wrapper for NSPersistentContainer - Easy Core Data Setup with iOS 10
//
// CoreDataController.swift
//
// Created by Keith Harrison http://useyourloaf.com
// Copyright (c) 2017 Keith Harrison. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright