Skip to content

Instantly share code, notes, and snippets.

View username0x0a's full-sized avatar
🐡
πŸ™‰ πŸ™ˆ πŸ™Š

Michal Zelinka username0x0a

🐡
πŸ™‰ πŸ™ˆ πŸ™Š
View GitHub Profile
//I also found that you can do:
//To register for change events:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_handleWhateverChange) name:@"whateverChange" object:nil];
//To fire them. I might be a N00b but I just couldn't get the observer for key path thing to work for me.
[[NSNotificationCenter defaultCenter] postNotificationName:@"whateverChange" object:nil];
@vyspiansky
vyspiansky / oddities.js
Last active December 4, 2019 08:12
JavaScript: oddities
/*
* Source: http://goo.gl/uCbje5
* Author: Eugene Zlobin
* Author Google+ Profile: http://goo.gl/REGj9K
*/
'5' + 4 // 54
5 + '4' // 54
5 + + '4' // 9
'5' * '2' // 10
@wesleyit
wesleyit / crontab_header.sh
Created September 26, 2014 20:03
A default crontab header that will make the life easier for those who don't remember cron fields or keywords.
## CRONTAB HINTS AND TIPS
##
##
## Entry Description Equivalent To
## @yearly (or @annually) Run once a year at midnight in the morning of January 1 0 0 1 1 *
## @monthly Run once a month at midnight in the morning of the first of the month 0 0 1 * *
## @weekly Run once a week at midnight in the morning of Sunday 0 0 * * 0
## @daily Run once a day at midnight 0 0 * * *
## @hourly Run once an hour at the beginning of the hour 0 * * * *
## @reboot Run at startup @reboot
@TheFox
TheFox / lldb_01.txt
Last active August 22, 2024 03:33
Cracking Hopper App
:> lldb Hopper.app
lldb:> target create "Hopper.app"
error: unable to find CIE at 0xf1bf1410 for cie_id = 0x0e410000 for entry at 0x00001404.
error: unable to find CIE at 0xfb722890 for cie_id = 0x048e0583 for entry at 0x00002e0f.
Current executable set to 'Hopper.app' (x86_64).
lldb:> run
Process 86127 launched: 'Hopper.app' (x86_64)
Process 86127 exited with status = 45 (0x0000002d)
@DaveWoodCom
DaveWoodCom / fixXcode6OnElCapitan.sh
Last active September 8, 2023 21:02
Script to fix Xcode 6.x so that it will run on El Capitan
#!/bin/bash
## Copyright (C) 2015 Cerebral Gardens http://www.cerebralgardens.com/
##
## Permission is hereby granted, free of charge, to any person obtaining a copy of this
## software and associated documentation files (the "Software"), to deal in the Software
## without restriction, including without limitation the rights to use, copy, modify,
## merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
## permit persons to whom the Software is furnished to do so, subject to the following
## conditions:
@scottstanfield
scottstanfield / osx-defaults.sh
Created July 18, 2016 03:40
Lots of OSX defaults
#!/bin/sh
# 90% from http://mths.be/osx
# ask for admin password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@steipete
steipete / SpinlockTestTests.swift
Last active January 20, 2025 15:55 — forked from RomanTruba/Synchronization_test_iOS_SDK10
Updated for Xcode 8, Swift 3; added os_unfair_lock
//
// SpinlockTestTests.swift
// SpinlockTestTests
//
// Created by Peter Steinberger on 04/10/2016.
// Copyright Β© 2016 PSPDFKit GmbH. All rights reserved.
//
import XCTest
#!/bin/sh
# default commands for osx to make it nicer to work with
##########################
# General UI?UX settings #
##########################
# Set hostname (hex of MVB9APPS)
sudo scutil --set ComputerName "0x4d56423941505053"
sudo scutil --set HostName "0x4d56423941505053"
@insidegui
insidegui / gist:a18124c0c573a4eb656f5c485ea7dae4
Last active February 9, 2025 18:03
Unofficial documentation for the iCloud Apple device image URL format
https://statici.icloud.com/fmipmobile/deviceImages-9.0/iPhone/iPhone9,4-2-3-0/online-infobox__3x.png
A B C D E F G
A: deviceImages version seems to determine the format of the image specifier (C, D, E, F)
B: device marketing name
C: device model identifier
D: color cover glass (front color)
1 - Black
2 - White
E: device enclosure color (back color)
@aykevl
aykevl / fire.py
Last active January 29, 2024 17:17
FastLED animations for MicroPython, see: https://forum.micropython.org/viewtopic.php?f=15&t=3749
import machine
import pixels
import array
import urandom
import time
# Source:
# https://github.com/FastLED/FastLED/blob/master/examples/Fire2012WithPalette/Fire2012WithPalette.ino
heatColors = array.array('L', [0x000000,