Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Perceval Faramaz perfaram

🎯
Focusing
Block or report user

Report or block perfaram

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CVE-2018-4150.c
/*
* Dodgy POC for my CVE-2018-4150 bug - @cmwdotme
*
* Bad locking lets you use BIOCSDLT and race BIOCSBLEN to increase the length without
* increasing/reallocating the buffer.. which lets you overflow ;) Should work up to iOS 11.2.6
*
*/
#include <fcntl.h>
#include <pthread.h>
@aepryus
aepryus / String+AE.swift
Created Mar 1, 2018
Swift String Extension for accessing Characters via Int; plus conversion to C
View String+AE.swift
//
// String+AE.swift
// Aepryus
//
// Created by Joe Charlier on 11/20/17.
// Copyright © 2017 Aepryus Software. All rights reserved.
//
import Foundation
@eddieantonio
eddieantonio / example.py
Created Mar 30, 2017
Zero-dependency Python 3 and Node IPC using UNIX sockets
View example.py
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import socket
import json
server_address = '/tmp/example.sock'
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect(server_address)
@Bogidon
Bogidon / GrowingTextView.swift
Last active Sep 18, 2019
A UITextView subclass that grows with its text but allows scrolling according to AutoLayout constraints. Updates intrinsicContentSize. For an animatable version see https://gist.github.com/Bogidon/632e265b784ef978d5d8c0b86858c2ee
View GrowingTextView.swift
//
// GrowingTextView.swift
// https://gist.github.com/Bogidon/cc0c9ae6f041413c39fb0ff146ad1b18
//
// Created by Bogdan Vitoc on 02/22/2017.
// Distributed under the MIT License: https://gist.github.com/Bogidon/cc0c9ae6f041413c39fb0ff146ad1b18#file-license
//
import UIKit
@Bogidon
Bogidon / AnimatedGrowingTextView.swift
Last active Aug 5, 2019
A short and understandable UITextView subclass that grows with its text. Animatable. Updates intrinsicContentSize. If you don't need animations check out https://gist.github.com/Bogidon/cc0c9ae6f041413c39fb0ff146ad1b18
View AnimatedGrowingTextView.swift
//
// AnimatedGrowingTextView.swift
// https://gist.github.com/Bogidon/632e265b784ef978d5d8c0b86858c2ee
//
// Created by Bogdan Vitoc on 02/15/2017.
// Distributed under the MIT License: https://gist.github.com/Bogidon/632e265b784ef978d5d8c0b86858c2ee#file-license
//
import UIKit
@jordanekay
jordanekay / Dictionary.swift
Last active Apr 2, 2018
Mapping dictionaries in Swift
View Dictionary.swift
extension Dictionary {
public func map<T: Hashable, U>(@noescape transform: (Key, Value) -> (T, U)) -> [T: U] {
var result: [T: U] = [:]
for (key, value) in self {
let (transformedKey, transformedValue) = transform(key, value)
result[transformedKey] = transformedValue
}
return result
}
@preble
preble / WeakSet.swift
Last active Nov 7, 2018
A pure Swift weak set.
View WeakSet.swift
//
// Created by Adam Preble on 2/19/15.
//
/// Weak, unordered collection of objects.
public struct WeakSet<T where T: AnyObject, T: Hashable> {
typealias Element = T
/// Maps Element hashValues to arrays of Entry objects.
/// Invalid Entry instances are culled as a side effect of add() and remove()
@ryancdotorg
ryancdotorg / rsabd.py
Last active Jun 27, 2019
backdoored rsa key generation
View rsabd.py
#!/usr/bin/env python
import sys
import gmpy
import curve25519
from struct import pack
from hashlib import sha256
from binascii import hexlify, unhexlify
@finalfantasia
finalfantasia / fixing_text_anti_aliasing_in_fedora.md
Last active Sep 26, 2019
Fixing Text Anti-aliasing in Fedora
View fixing_text_anti_aliasing_in_fedora.md
  1. Add the RPMFusion repositories (both free and non-free) to the YUM repository directory (/etc/yum.repos.d/):
sudo dnf localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
  1. Install the patched version of FreeType with subpixel rendering enabled:
sudo dnf install -y freetype-freeworld
View KBCollectionExtensions.h
//
// KBCollectionExtensions.h
//
// Created by Guy English on 25/02/08.
// Copyright 2008 Kickingbear. All rights reserved.
//
#import <Cocoa/Cocoa.h>
/*
You can’t perform that action at this time.