Skip to content

Instantly share code, notes, and snippets.

@akfreas
akfreas / find_replace.sh
Created January 24, 2024 16:55
Find and replace filenames and references
'
# File Replacement and Backup Script
This script is designed to search through files within a specified directory, replace occurrences of a search string with a replacement string, and backup the original files.
It will rename every instance of that string, found not only in the files themselves, but also in the filename and directory name.
## Features
- Searches for files containing a specific string.
- Replaces the found string with a new string.
@akfreas
akfreas / translate_strings.py
Created January 18, 2024 10:49
Auto Translate iOS Strings
#!/usr/bin/env python3
import argparse
import os
import openai
from pprint import pprint
import os
from openai import OpenAI
from tqdm import tqdm
@akfreas
akfreas / ipin.py
Created March 25, 2014 21:04 — forked from shinyzhu/ipin.py
#---
# iPIN - iPhone PNG Images Normalizer v1.0
# Copyright (C) 2007
#
# Author:
# Axel E. Brzostowski
# http://www.axelbrz.com.ar/
# axelbrz@gmail.com
#
# References:
@akfreas
akfreas / ipin.py
Created November 2, 2012 07:13 — forked from shinyzhu/ipin.py
iPIN - iPhone PNG Images Normalizer
#---
# iPIN - iPhone PNG Images Normalizer v1.0
# Copyright (C) 2007, 2012
#
# Author:
# Alexander Freas
# www.sashimiblade.com
# alex@sashimiblade.com
#
#
#!/usr/bin/env python
import biplist
import os
import requests
import tempfile
import sys
import git
testflight_api_url = "http://testflightapp.com/api/builds.json"
{
"expose.expose": {
"@xlink.href": "https://rest.sandbox-immobilienscout24.de/restapi/api/search/v1.0/expose/314747248",
"@id": "314747248",
"@modification": "2019-11-27T13:26:20.793Z",
"@creation": "2019-03-19T12:57:04.000+01:00",
"@publishDate": "2019-03-19T12:57:04.000+01:00",
"@contactFormType": "EMAIL",
"realEstate": {
"@xsi.type": "expose:ApartmentRent",
@akfreas
akfreas / CounterViewController.swift
Created April 9, 2019 06:48
CounterViewController.swift
public class CounterViewController: UIViewController {
@IBOutlet internal var counterButton: UIButton?
@IBOutlet internal var counterLabel: UILabel?
....
@akfreas
akfreas / AppDelegate.swift
Created April 8, 2019 21:49
SimpleCounter AppDelegate
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? = UIWindow(frame: UIScreen.main.bounds)
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window?.rootViewController = CounterViewController()
window?.makeKeyAndVisible()
def feed_pods
pod 'SVProgressHUD', SVProgressHUDVersion
pod 'RxSwift', RxSwiftVersion
pod 'RxCocoa', RxSwiftVersion
pod 'Shimmer', ShimmerVersion
end
def extract_pngs_from_ttf():
with open('/System/Library/Fonts/Apple Color Emoji.ttc', 'rb') as ttf:
pos = 0
png_seq = '\x89\x50\x4E\x47\x0D\x0A\x1A\x0A'
end_seq = '\x49\x45\x4E\x44'
byte = ttf.read(8)
current_png = None