Skip to content

Instantly share code, notes, and snippets.

@chiliec
chiliec / generate.ts
Created April 19, 2024 08:19
Stable Diffusion 3.0 (SD3) image-to-image code example
import FormData from "form-data";
import fs from "node:fs";
import axios from "axios";
export async function generate(
originalImagePath: string,
resultImageName: string,
prompt: string,
negativePrompt: string,
strength: number,
@jasonbekolay
jasonbekolay / trigger webViewWebContentProcessDidTerminate in simulator
Last active April 25, 2024 10:24
Killing a WKWebView content process in the iOS simulator to trigger a webViewWebContentProcessDidTerminate call
# In the command line, find the PID of your simulator process:
ps -p `pgrep launchd_sim`
# or if you have many simulators running:
ps -A | grep launchd_sim
# Find the PID of the WebContent process:
pgrep -P <simulator-pid> 'com.apple.WebKit.WebContent'
# kill it
@victor-homyakov
victor-homyakov / detect-unused-css-selectors.js
Last active February 17, 2023 18:36
Detect unused CSS selectors. Show possible CSS duplicates. Monitor realtime CSS usage.
/* eslint-disable no-var,no-console */
// detect unused CSS selectors
(function() {
var parsedRules = parseCssRules();
console.log('Parsed CSS rules:', parsedRules);
detectDuplicateSelectors(parsedRules);
var selectorsToTrack = getSelectorsToTrack(parsedRules);
window.selectorStats = { unused: [], added: [], removed: [] };
console.log('Tracking style usage (inspect window.selectorStats for details)...');
@julesjans
julesjans / screen-gif.sh
Last active May 8, 2021 16:40
Capture iOS Simulator to animated gif
# Turn on the simulator screen capture
xcrun simctl io booted recordVideo ~/simulator.mov
# Convert the iPhone 6s screen shot into a gif:
ffmpeg -i ~/simulator.mov -vf scale=320:-1 -r 6 -f gif -y simulator.gif
fastlane_version "1.33.0"
default_platform :ios
platform :ios do
before_all do
cocoapods
ENV['KEYCHAIN_NAME'] = "TempKeychain.keychain"
end
@jverkoey
jverkoey / Tuple+Generator.swift
Last active February 3, 2018 22:59
Tuple enumeration
/** The returned generator will enumerate each value of the provided tuple. */
func generatorForTuple(tuple: Any) -> AnyGenerator<Any> {
return anyGenerator(Mirror(reflecting: tuple).children.lazy.map { $0.value }.generate())
}
// Blogged at http://design.featherless.software/enumerating-tuple-values-swift/
Project # of Top 100 Free Apps (US)
facebook-ios-sdk 67
Bolts-iOS 48
AFNetworking 39
Google-Mobile-Ads-SDK 38
Reachability (Apple) 38
Crashlytics 37
Flurry-iOS-SDK 31
CocoaPods 30
GoogleConversionTracking 29
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

@arturlector
arturlector / ios-questions-interview.md
Last active February 25, 2024 18:44
Вопросы на собеседование iOS разработчика.

Вопросы на собеседование iOS разработчика (дополненное издание):

General:

  • Что такое полиморфизм?

  • Что такое *инкапсуляция? Что такое *нарушение инкапсуляции?

  • Чем абстрактный класс отличается от интерфейса?

  • Расскажите о паттерне MVC. Чем отличается пассивная модель от активной?

@ahmpro
ahmpro / habr.htm
Last active August 29, 2015 14:07
Хабрахабр — профилактика
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Хабрахабр / Профилактические работы</title>
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport">
<style>
@font-face {
font-family: 'PT Sans';
font-style: normal;