Skip to content

Instantly share code, notes, and snippets.

View VivienGiraud's full-sized avatar
🏒
Freelancing

Vivien Giraud VivienGiraud

🏒
Freelancing
View GitHub Profile
@Tokuriku
Tokuriku / Count lines of code in Xcode project
Last active June 30, 2024 21:09 — forked from ccabanero/Count lines of code in Xcode project
Count lines of code in SWIFT Xcode project
1. Open Terminal
2. cd to your Xcode project
3. Execute the following when inside your target project:
find . -name "*.swift" -print0 | xargs -0 wc -l

Git Cheat Sheet

Commands

Getting Started

git init

or

@TylerOderkirk
TylerOderkirk / dump_AT45DB041B.py
Last active December 6, 2022 17:42
A script to dump an Atmel AT45DB041B 4Mbit SPI Flash part's contents to disk using a Bus Pirate.
#!/usr/bin/env python
# dump the contents of an atmel AT45DB041B flash part to 'data.bin'
# usage: ./dump_AT45DB041B.py /dev/ttyUSB0
# tested w/ https://github.com/audiohacked/pyBusPirate ac19e00b53, Bus Pirate Hardware labelled v3.6, Firmware: "Bus Pirate v3b, Firmware v5.10 (r559), Bootloader v4.4"
# bugs: slow. as in... dozens of hours :/
@bramswenson
bramswenson / sqs_notes.md
Last active September 25, 2020 07:27
Amazon SQS Notes
@philipn
philipn / gist:cc873d7311f12eac0f68
Last active April 19, 2022 08:39
Using i18n LANGUAGE_CODE(s) with django-compressor offline compression
"""
A replacement for the django-compressor `compress` management command that renders all
templates with each `LANGUAGE_CODE` available in your `settings.LANGUAGES`.
Useful for making static-i18n work with django-compressor, among other things.
"""
import os
from os.path import join
import json
@pietbrauer
pietbrauer / MD5.swift
Created August 10, 2014 16:59
NSString & NSData to MD5
import Foundation
extension NSData {
func MD5() -> NSString {
let digestLength = Int(CC_MD5_DIGEST_LENGTH)
let md5Buffer = UnsafeMutablePointer<CUnsignedChar>.alloc(digestLength)
CC_MD5(bytes, CC_LONG(length), md5Buffer)
var output = NSMutableString(capacity: Int(CC_MD5_DIGEST_LENGTH * 2))
for i in 0..<digestLength {
@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()
@staltz
staltz / introrx.md
Last active April 29, 2025 08:33
The introduction to Reactive Programming you've been missing
@AGWA
AGWA / rpi-hdmi.sh
Last active January 10, 2025 16:18
Enable and disable the HDMI port on the Raspberry Pi: `rpi-hdmi on` to turn on, `rpi-hdmi off` to turn off. X is properly reinitialized when re-enabling.
#!/bin/sh
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
{
tvservice -s | grep "TV is off" >/dev/null
}
case $1 in
@neilstuartcraig
neilstuartcraig / ghost-ses-smtp-config
Created October 17, 2013 14:08
An extract of config.js for ghost (http://ghost.org) blog app (nodejs) to allow sending email via SES (over SSL). Note that this will fail if your website is not return-connectable by SES on your defined ghost URL i.e. your blog must be publicily available, not just runnnig on e.g. a private VM. If you're running under HTTPS then your SSL cert m…
mail: {
transport: 'SMTP',
host: 'ssl://email-smtp.us-east-1.amazonaws.com',
options: {
port: 465,
service: 'SES',
auth: {
user: 'YOUR-SES-ACCESS-KEY-ID',
pass: 'YOUR-SES-SECRET-ACCESS-KEY'
}