Skip to content

Instantly share code, notes, and snippets.

View augustmuir's full-sized avatar

August Muir Kimacovich augustmuir

View GitHub Profile
@parafeu
parafeu / scrollbar.js
Last active September 3, 2022 19:29
Scrollbar plugin tailwindcss
const plugin = require("tailwindcss/plugin");
module.exports = plugin(function ({ addUtilities, matchUtilities, theme }) {
const scrollbarTrackColorValue = (value) => ({
'--scrollbar-track': value,
'&::-webkit-scrollbar-track': {
"background-color": value
}
})
@eneko
eneko / dealloc-breakpoint.md
Last active January 3, 2024 02:24
Xcode UIViewController dealloc breakpoint

Xcode deinit breakpoint for UIViewController

This breakpoint provides an easy way to track view controller deinitialization (deallocation) in UIKit-based applications. This can help finding memory leaks caused by retain cycles preventing view controllers from being deinitialized when dismissed or popped.

From Cédric Luthi's tweet in 2017:

Useful Xcode breakpoint. When you dismiss a controller and you don’t hear the pop sound (or see the log), you probably have a retain cycle.

import React, { useRef, useEffect, memo } from 'react'
import { useRouter } from 'next/router'
const ROUTES_TO_RETAIN = ['/dashboard', '/top', '/recent', 'my-posts']
const App = ({ Component, pageProps }) => {
const router = useRouter()
const retainedComponents = useRef({})
const isRetainableRoute = ROUTES_TO_RETAIN.includes(router.asPath)
@saitbnzl
saitbnzl / hex_to_ascii.dart
Created September 29, 2019 15:14
hex string to ascii string in dart
void main() {
String hexString =
"687474703A2F2F65727063727033752E706F61732E636F6D2E74723A383030302F4F415F48544D4C2F58787063417070536572766C65742E6A7370";
List<String> splitted = [];
for (int i = 0; i < hexString.length; i = i + 2) {
splitted.add(hexString.substring(i, i + 2));
}
String ascii = List.generate(splitted.length,
(i) => String.fromCharCode(int.parse(splitted[i], radix: 16))).join();
print('${ascii}');