This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) Karim Abou Zeid | |
from typing import Any | |
import lightning.pytorch as pl | |
import torch | |
from lightning.pytorch.callbacks.callback import Callback | |
from lightning.pytorch.utilities.exceptions import MisconfigurationException | |
from lightning.pytorch.utilities.types import STEP_OUTPUT | |
from typing_extensions import override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) Karim Abou Zeid | |
from typing import Any | |
import lightning.pytorch as pl | |
from lightning.pytorch.callbacks.callback import Callback | |
from lightning.pytorch.utilities.exceptions import MisconfigurationException | |
from lightning.pytorch.utilities.types import STEP_OUTPUT | |
from typing_extensions import override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>Label</key> | |
<string>codes.ka.ssh-add-keychain</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/ssh-add</string> | |
<string>--apple-load-keychain</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fontforge | |
# Usage: patch.ff <font_to_patch> <symbol_font_1> ... <symbol_font_n> | |
Open($1) | |
### | |
### PS NAMES | |
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# USAGE: ./set_default_editor.sh "visual studio code" | |
APP_ID=$(osascript -e "id of app \"$*\"") # eg com.microsoft.VSCode | |
curl "https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml" \ | |
| yq -r "to_entries | (map(.value.extensions) | flatten) - [null] | unique | .[]" \ | |
| xargs -L 1 -I "{}" duti -s "${APP_ID}" {} all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Code copied from `https://github.com/laravel/valet/blob/d312a588f352c4b5c62b75c4abd1897403b04b76/cli/drivers/LaravelValetDriver.php` (13. April 2021) | |
class LaravelViteValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSManagedObjectExtension.swift | |
// | |
// Created by Karim Abou Zeid on 10.06.18. | |
// Copyright © 2018 Karim Abou Zeid Software. All rights reserved. | |
// | |
import CoreData | |
extension NSManagedObject { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET(MCU "atmega644") | |
SET(F_CPU "20000000") | |
SET(CMAKE_SYSTEM_NAME Generic) | |
SET(CMAKE_C_COMPILER /usr/local/CrossPack-AVR/bin/avr-gcc) | |
SET(CMAKE_CXX_COMPILER /usr/local/CrossPack-AVR/bin/avr-g++) | |
SET(CMAKE_C_FLAGS "-mmcu=${MCU} -DF_CPU=${F_CPU} -O1 -std=gnu99 -Wall") | |
SET(CMAKE_C_LINK_FLAGS "-mmcu=${MCU}") | |
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apkname=$(basename "$1" .apk) | |
extractfolder=$PWD/$apkname | |
unzip -o "$1" classes.dex -d "$extractfolder" | |
d2j-dex2jar "$extractfolder/classes.dex" -o "$extractfolder/$apkname.jar" | |
apktool d "$1" -o "$extractfolder/apktool" -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kabouzeid.gramophone.helper; | |
/** | |
* Simple thread safe stop watch. | |
* | |
* @author Karim Abou Zeid (kabouzeid) | |
*/ | |
public class StopWatch { | |
/** |
NewerOlder