Skip to content

Instantly share code, notes, and snippets.

View unixb0y's full-sized avatar
👨‍💻
Hacking

Dave unixb0y

👨‍💻
Hacking
  • Planet Earth
View GitHub Profile
@skymobilebuilds
skymobilebuilds / carthage-xc12.sh
Last active May 17, 2022 12:36
Xcode 13 and 12 Carthage Build Workaround
#!/bin/bash -e
echo "🤡 Applying carthage 12 and 13 workaround 🤡"
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' > $xcconfig
echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig

How the NZXT Hue+ works

Also applies to the NZXT Smart Device

TL; DR

Hue+ accessories use WS2812B integrated LED and controllers. Pinout is:

  • +5V (marked with arrow; corresponding wire with white stripe)
  • IN (data in)
@troyfontaine
troyfontaine / 1-setup.md
Last active May 3, 2024 10:52
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@ericdke
ericdke / emojiImage.swift
Created June 17, 2017 08:56
Swift 4 String extension for converting an emoji to an NSImage. Idea and original code by Daniel Jalkut http://indiestack.com/2017/06/evergreen-images/.
import Cocoa
extension String {
// https://stackoverflow.com/a/36258684/2227743
var containsEmoji: Bool {
for scalar in self.unicodeScalars {
switch scalar.value {
case 0x1F600...0x1F64F, // Emoticons
0x1F300...0x1F5FF, // Misc Symbols and Pictographs
@cgiffard
cgiffard / last-posts.csv
Last active October 21, 2017 19:03
The last 100 posts on App.net.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
Post ID, Post Timestamp, Username, Text (including machine posts)
"71081328","2017-03-17T10:03:07Z","voguemagazine","Miss Rodeo New Mexico 2016 Shows Vogue The Ropes | American Women — https://app.net/b/rqg5g"
"71081327","2017-03-17T08:04:35Z","epicurious","Classic Potato Kugel for Passover | Epicurious — https://app.net/b/rqg56"
"71081326","2017-03-17T07:07:15Z","cgiffard","Midnight PST and things are still going?"
"71081325","2017-03-17T06:45:35Z","joanna","But not forgotten. :-)"
"71081324","2017-03-17T06:43:58Z","joanna","Gone?"
"71081323","2017-03-17T06:39:02Z","joanna","Still have this channel. I don't want to close my browser!"
"71081322","2017-03-17T06:38:38Z","phoneboy","Yup, looks like the API server has shut down."
"71081321","2017-03-17T06:38:18Z","joanna","Global won't refresh on Riposte."
"71081320","2017-03-17T06:37:53Z","djscolam","#NowPlaying End Theme - Zero 7 [youtu.be] Requested by: @berg #MondayNightDanceParty #BeExcellentToEachOther. //@adnprinter #adnprinter
@dschep
dschep / raspbian-python3.6.rst
Last active October 24, 2023 14:57 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).

anonymous
anonymous / r-array-gen.py
Created October 24, 2016 13:33
Small script to generate resistor-arrays for fritzing. See http://forum.fritzing.org/t/2079 for more information.
#!/usr/bin/env python
# coding=utf-8
# This script generates resistor-arrays of various sizes.
# See: http://forum.fritzing.org/t/2079
import svgwrite as svg
from svgwrite.base import BaseElement
from svgwrite.mixins import Presentation, Markers, Transform
import os
@bmhatfield
bmhatfield / .profile
Last active May 6, 2024 22:27
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@licvido
licvido / RBResizer.swift
Last active September 18, 2023 11:36 — forked from HamptonMakes/RBResizer.swift
SWIFT: Crop image to square (& resize)
//
// RBResizer.swift
// Locker
//
// Created by Hampton Catlin on 6/20/14.
// Copyright (c) 2014 rarebit. All rights reserved.
//
import UIKit
@umidjons
umidjons / dos2unix.md
Created July 18, 2014 04:55
Execute dos2unix for directory recursively.

Will recursively find all files inside current directory and call for these files dos2unix command. Would break if you had spaces in file name.

find . -type f -exec dos2unix {} \;

Wouldn't break if you had spaces in file names.

find . -type f -print0 | xargs -0 dos2unix