Skip to content

Instantly share code, notes, and snippets.

View mwrites's full-sized avatar
🔧

Mathieu mwrites

🔧
View GitHub Profile
@mwrites
mwrites / cuda_install.md
Created January 19, 2024 02:05 — forked from denguir/cuda_install.md
Installation procedure for CUDA & cuDNN

How to install CUDA & cuDNN on Ubuntu 22.04

Install NVIDIA drivers

Update & upgrade

sudo apt update && sudo apt upgrade

Remove previous NVIDIA installation

@mwrites
mwrites / curl.md
Created August 18, 2021 11:10 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@mwrites
mwrites / android_instructions.md
Created February 6, 2020 19:53 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@mwrites
mwrites / graphs.py
Last active September 20, 2018 05:33 — forked from daveweber/graphs.py
Breadth First and Depth First Search in Python
# https://eddmann.com/posts/depth-first-search-and-breadth-first-search-in-python/
def bfs(graph, start):
visited, queue = set(), [start]
while queue:
vertex = queue.pop(0)
if vertex not in visited:
visited.add(vertex)
queue.extend(graph[vertex] - visited)
return visited
@mwrites
mwrites / In_your_networking_class.swift
Created February 1, 2018 07:36 — forked from giulio92/In_your_networking_class.swift
NSURLSession Proxy configuration
let sessionConfiguration: URLSessionConfiguration = .default
let proxyConfiguration: [AnyHashable : Any] = [
kCFNetworkProxiesHTTPEnable as AnyHashable: true,
kCFNetworkProxiesHTTPPort as AnyHashable: [Place-proxy's-port-number-here],
kCFNetworkProxiesHTTPProxy as AnyHashable: "Place-your-proxy-address-here"
]
sessionConfiguration.connectionProxyDictionary = proxyConfiguration
@mwrites
mwrites / TextSize.swift
Created October 8, 2017 09:29 — forked from gnou/TextSize.swift
Calculate height of some text when width is fixed
public struct TextSize {
fileprivate struct CacheEntry: Hashable {
let text: String
let font: UIFont
let width: CGFloat
let insets: UIEdgeInsets
fileprivate var hashValue: Int {
return text.hashValue ^ Int(width) ^ Int(insets.top) ^ Int(insets.left) ^ Int(insets.bottom) ^ Int(insets.right)
@mwrites
mwrites / gist:51ecca480fb8ddc4fc6ed9835d45cb44
Created July 18, 2017 12:04 — forked from krzysztofzablocki/gist:4396302
Set symbol breakpoint on objc_msgSend then setup this debug command to log all methods called in iOS Simulator. If you want to do device debugging change esp+4 register to r0, esp+8 to r1 Found long ago somewhere on stackoverflow.
expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) )