Skip to content

Instantly share code, notes, and snippets.

View fal3's full-sized avatar

Alex A. Fallah fal3

View GitHub Profile
@cmer
cmer / waketv.lua
Last active May 13, 2024 19:34
Wake TV when MacOS wakes from sleep (Hammerspoon)
-- -------------------------------------------------------------------
-- THIS SCRIPT IS NOW DEPRECATED IN FAVOR OF A MORE ROBUST SOLUTION --
-- Please refer to https://github.com/cmer/lg-tv-control-macos/
-- -------------------------------------------------------------------
local tv_identifier = "LG TV"
local mac_address = "aa:bb:cc:dd:ee:ff"
local tv_found = (hs.screen.find(tv_identifier) ~= nil)
local debug = false -- Set to true to enable debug messages
@othyn
othyn / Docker connect to remote server.md
Created July 15, 2021 09:11 — forked from kekru/Docker connect to remote server.md
Connect to another host with your docker client, without modifying your local Docker installation

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.

@othyn
othyn / write_bootable_windows_iso_to_usb.sh
Last active November 2, 2023 15:25
Quick script to write a bootable UEFI Windows ISO to USB in macOS
#!/bin/bash
# System: Darwin x86_64 19.6.0 (macOS 10.15.6 19G2021)
# Author: Othyn (https://github.com/othyn)
# Source: https://gist.github.com/othyn/29b82e39eb8cdd98adf1be77cbb62700
# Dependencies: pv, wimlib
# Licence: MIT
DEFAULT="\x1b[0m"
RED="\x1b[31m"
@danielmartin
danielmartin / BetterXcodeJumpToCounterpartSwift.org
Last active March 9, 2024 02:00
Add support for a better Xcode's Jump to Next Counterpart in Swift

If you work on a Swift project that follows the Model-View-ViewModel (MVVM) architecture or similar, you may want to jump to counterpart in Xcode from your view to your model, and then to your view model. (ie. by using Ctrl+Cmd+Up and Ctrl+Cmd+Down).

You can do this in recent versions of Xcode by setting a configuration default.

From a terminal, just type this command and press Enter:

defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View"
@FranDepascuali
FranDepascuali / boot_app_multiple_simulators.rb
Last active March 22, 2022 19:35
Builds iOS app (only once) for multiple simulators.
DEFAULT_SIMULATORS = ['iPhone 5s', 'iPhone 8', 'iPhone X', 'iPhone Xʀ']
PROJECT_PATH = # Project path.
SCHEME = ... # (Your scheme)
CONFIGURATION = ... # (usually Debug or Release)
APP_ID = # Your app id. i.e: com.company.app
APP_NAME = # The output name of your app.
platform :ios do
@cdelgadob
cdelgadob / cleanTypenameFieldLink.ts
Last active August 9, 2022 18:20
This is a custom ApolloLink which we use to clean the "__typename" field to prevent sending it to the GraphQL server. omitDeep based on this gist: https://gist.github.com/Billy-/d94b65998501736bfe6521eadc1ab538
@durul
durul / Xcode Defaults.md
Last active November 5, 2018 16:12
Xcode Defaults

Xcode Defaults

Command Line

# Enable internal menu
defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES

# Enable project build time
@hexerei
hexerei / index.html
Created May 26, 2017 10:16
Liquid number format with thousands and decimal seperator
<h1>Usage Template</h1>
<h2>With integer to decimal conversion</h2>
<p>
{% include numf.html number=12345 %} <!-- output is 12.345,00 --><br />
{% include numf.html number=12345 decimals=0 %} <!-- output is 12.345 --><br />
{% include numf.html number=12345 decimals=4 %} <!-- output is 12.345.0000 --><br />
{% include numf.html number=12345 ds='.' ts=',' %} <!-- output is 12,345.00 --><br />
</p>
import Foundation
import PlaygroundSupport
/// A thread-safe array.
public class SynchronizedArray<Element> {
private let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent)
private var array = [Element]()
public init() { }
@johnteske
johnteske / index.html
Created January 5, 2017 18:49
Liquid number format with commas
{% include numberWithCommas.html number=1 %}
{% include numberWithCommas.html number=12 %}
{% include numberWithCommas.html number=123 %}
{% include numberWithCommas.html number=1234 %}
{% include numberWithCommas.html number=12345 %}
{% include numberWithCommas.html number=123456 %}
{% include numberWithCommas.html number=1234567 %}
{% include numberWithCommas.html number=12345678 %}
{% include numberWithCommas.html number=123456789 %}
{% include numberWithCommas.html number=1234567890 %}