Skip to content

Instantly share code, notes, and snippets.

View danielsneijers's full-sized avatar

Dan Sneijers danielsneijers

View GitHub Profile
@simbo
simbo / raspberry-pi-setup.md
Last active January 26, 2023 15:38
Setting up a Raspberry Pi (Model B Rev 2, armv6l) with a linux without desktop, controlled remotely via ssh, installed zsh, pure prompt, ufw, git, node.js, npm, yarn, nginx with ssl

Setting up a Raspberry Pi (Model B Rev 2, armv6l)

How to setup a pi with a linux without desktop, controlled remotely via ssh.

Installing: zsh, pure prompt, ufw, git, node.js, npm, yarn, nginx with ssl, pi-hole.

Prepare SD Card

Download the Raspberry Pi Imager,

@Amzd
Amzd / Navigation.swift
Last active July 6, 2023 03:34
Fix the back swipe gesture not working correctly in SwiftUI. https://stackoverflow.com/a/58345554/3393964
/// Fixed swipe gesture NavigationLink
struct NavigationLink<Destination: View, Label:View>: View {
var destination: Destination
var label: () -> Label
public init(destination: Destination, @ViewBuilder label: @escaping () -> Label) {
self.destination = destination
self.label = label
}
//
// ImagePicker.swift
//
// Created by Vlad Lego on 15/07/2019.
// vlad@iSelf.com
//
import SwiftUI
import Combine
@ireade
ireade / sw.js
Last active October 7, 2023 20:56
Handle broken images with the service worker
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open("precache").then((cache) => cache.add("/broken.png"))
);
});
function isImage(fetchRequest) {
return fetchRequest.method === "GET" && fetchRequest.destination === "image";
}
@jamesgathu
jamesgathu / AudioMerge.swift
Last active October 24, 2023 14:29
**Merging Multiple Audio Files in iOS**
/**
provide an array of audio files urls and get them merged
Its important to note that the process is asynchronous and that one would need to show user some sort of a progress indicator
so that the process does not get interupted
- parameter audioFileUrls: an array of audio file urls
- returns String representing the newly merged file or nil for a failure
*/
func mergeAudioFiles(audioFileUrls: [URL]) -> String? {
let composition = AVMutableComposition()
@ibraheem4
ibraheem4 / postgres-brew.md
Last active May 1, 2024 09:43 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@jacoduplessis
jacoduplessis / polyfills.html
Last active September 6, 2018 12:15
Load Promise and Fetch polyfills conditionally (updated 8 Jan 2016)
<script>
window.Promise || document.write('<script src="https://unpkg.com/es6-promise@4.0.5/dist/es6-promise.min.js"><\/script>');
window.fetch || document.write('<script src="https://unpkg.com/whatwg-fetch@1.1.1/fetch.js"><\/script>');
</script>
@Limon-O-O
Limon-O-O / AVCaptureDevice+FrameRate.swift
Created October 31, 2016 07:48
Control video frame rate with AVFoundation
extension AVCaptureDevice {
/// http://stackoverflow.com/questions/21612191/set-a-custom-avframeraterange-for-an-avcapturesession#27566730
func configureDesiredFrameRate(_ desiredFrameRate: Int) {
var isFPSSupported = false
do {
if let videoSupportedFrameRateRanges = activeFormat.videoSupportedFrameRateRanges as? [AVFrameRateRange] {
@mvaneijgen
mvaneijgen / material-theme.terminal
Created June 15, 2015 20:27
material-theme.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKSpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMXGyImVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECgwLjAyNzQ1MTAw
NjcgMC4yMTE3NjQ3MjMxIDAuMjU4ODIzNDg0MiAxTxAoMC4wMzkzODA3NDc4MiAwLjE2
@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 22, 2024 10:15
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?