Skip to content

Instantly share code, notes, and snippets.

Karolis Stasaitis carlossless

Block or report user

Report or block carlossless

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
Mahedi-61 / cuda_10.1_installation_on_Ubuntu_18.04
Last active Jun 3, 2020
CUDA 10.1 Installation on Ubuntu 18.04
View cuda_10.1_installation_on_Ubuntu_18.04
## This gist contains instructions about cuda v10.1 and cudnn 7.6 installation in Ubuntu 18.04 for Tensorflow 2.1.0
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
lattner /
Last active Jun 1, 2020 — forked from oleganza/
Concrete proposal for async semantics in Swift

Async/Await for Swift


Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

sjoerdvisscher / minimal.swift
Created Jun 28, 2017
Using Decodable to generate a minimal value
View minimal.swift
struct MinimalDecoder : Decoder {
var codingPath = [CodingKey?]()
var userInfo = [CodingUserInfoKey : Any]()
public func container<Key>(keyedBy type: Key.Type) throws -> KeyedDecodingContainer<Key> {
return KeyedDecodingContainer(MinimalKeyedDecodingContainer<Key>(decoder: self))
public func unkeyedContainer() throws -> UnkeyedDecodingContainer {
return DecodingContainer(decoder: self)
Catfish-Man / lockcachecontention.m
Last active Jul 5, 2017
Benchmark showing how locks sharing a cache line will contend with each other
View lockcachecontention.m
#import <Foundation/Foundation.h>
#import <time.h>
#import <os/lock.h>
#define ITERS 2000
#define NSEC_PER_ITER(time) (((double)time * (double)NSEC_PER_SEC) / (double)ITERS)
#define TEST(body, name) do {\
start = [NSDate date];\
for (int i = 0; i < ITERS; i++) {\
Nihisil / jail.local
Last active Apr 21, 2020
Send notifications to the Slack from fail2ban
View jail.local
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
action = %(action_with_slack_notification)s
View Twitter API with Curl
# create an account, create an app
# @see
# retrieve the access tokens
# @see
# create the file ~/twitter_api
nano ~/twitter_api
Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0"
felix-schwarz /
Last active May 18, 2020 — forked from steipete/openssl-build.h
Updated script that builds OpenSSL for OS X, iOS and tvOS. Bitcode enabled for iOS, tvOS. Updated to build for tvOS, use the latest SDKs, skip installing man pages (to save time), download the OpenSSL source over HTTPS, patch OpenSSL for tvOS to not use fork(). Currently requires Xcode7.1b or later (for the tvOS SDK).
# This script downloads and builds the iOS, tvOS and Mac openSSL libraries with Bitcode enabled
# Credits:
# Peter Steinberger, PSPDFKit GmbH, @steipete.
# Felix Schwarz, IOSPIRIT GmbH, @felix_schwarz.
0xced / MoviePlayerControllerDoneButton.h
Created Dec 17, 2014
Access the "Done" button of a MPMoviePlayerController
View MoviePlayerControllerDoneButton.h
#import <MediaPlayer/MediaPlayer.h>
* Example usage:
* UIButton *doneButton = MoviePlayerControllerDoneButton(moviePlayerViewController.moviePlayer);
* [doneButton setTitle:@"✖" forState:UIControlStateNormal];
* doneButton.titleLabel.font = [UIFont systemFontOfSize:30];
extern UIButton * MoviePlayerControllerDoneButton(MPMoviePlayerController *moviePlayerController);
msealand / CGVectorUtilities.swift
Last active Sep 4, 2019
Operator overloads to do scalar vector math on CGPoint, CGSize, CGVector.
View CGVectorUtilities.swift
import CoreGraphics
protocol VectorType {
typealias Element
var xElement: Element { get }
var yElement: Element { get }
class func buildFrom(#x: Element, y: Element) -> Self
niun /
Last active Nov 27, 2019
Find Raspberry Pi in network (looking for MAC address vendor prefix of Raspberry Pi Foundation using nmap, awk for ipv4 / ping6, ip, grep for ipv6 neighbour discovery)
sudo nmap -sP | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'
You can’t perform that action at this time.