Skip to content

Instantly share code, notes, and snippets.

View davidepedranz's full-sized avatar

Davide Pedranz davidepedranz

View GitHub Profile
@davidepedranz
davidepedranz / MyApp.swift
Last active April 15, 2023 12:40
[SwiftUI + TCA] Programmatic sheet dismissal
///
/// Demo application based on SwiftUI and The Composable Architecture (TCA)
/// that shows a possible approach to programmativally dismiss sheets.
///
/// Is this approach the best one? Fedback wanted :pray:
///
import ComposableArchitecture
import SwiftUI
@davidepedranz
davidepedranz / Common-Currency.json
Created April 26, 2020 12:45 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@davidepedranz
davidepedranz / new-wireguard-peer.sh
Created July 14, 2019 19:56 — forked from robinlandstrom/new-wireguard-peer.sh
Script to automatically add configration for a new peer to a wireguard server. It will then print a QR code to the console that can be used to add the config to the Android or OS X wireguard client.
#!/bin/bash
readonly INTERFACE="wg0"
# Generate peer keys
readonly PRIVATE_KEY=$(wg genkey)
readonly PUBLIC_KEY=$(echo ${PRIVATE_KEY} | wg pubkey)
readonly PRESHARED_KEY=$(wg genpsk)
# Read server key from interface
@davidepedranz
davidepedranz / ca.md
Created January 28, 2019 21:47 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@davidepedranz
davidepedranz / keybase.md
Created April 30, 2018 18:21
keybase.md

Keybase proof

I hereby claim:

  • I am davidepedranz on github.
  • I am davidepedranz (https://keybase.io/davidepedranz) on keybase.
  • I have a public key whose fingerprint is 4F3F CA22 83BE 2773 7AC5 E954 8391 E099 C6A6 1175

To claim this, I am signing this object:

@davidepedranz
davidepedranz / gulpfile.js
Created October 24, 2015 23:05
Rename + resize photos with Gulp.js
var path = require('path');
var gulp = require('gulp');
var del = require('del');
var sort = require('gulp-sort');
var rename = require('gulp-rename');
var debug = require('gulp-debug');
var gm = require('gulp-gm');
var imagemin = require('gulp-imagemin');
var jpegtran = require('imagemin-jpegtran');