Skip to content

Instantly share code, notes, and snippets.

View lhunath's full-sized avatar

Maarten Billemont lhunath

View GitHub Profile
@lhunath
lhunath / RemoveWhenEmpty.swift
Created December 12, 2024 13:42
Remove empty SwiftUI view from the layout entirely, re-adding it when it becomes non-empty.
extension View {
/// While this view's geometry is empty, remove it from the layout. The view is added back when the geometry becomes non-empty again.
public func removeWhenEmpty() -> some View {
self.modifier(RemoveWhenEmptyModifier())
}
}
private var removeEmptyViews: Set<UUID> = []
private struct RemoveWhenEmptyModifier: ViewModifier {
@State
@lhunath
lhunath / gist:e7179ee69a66c6789fc4
Created February 23, 2016 03:22
Netflix.com support transcript after 2016 VPN blockage
Thank you for contacting Netflix customer support.
Here is the transcript from your recent chat with customer support:
Netflix Ronnie
Thanks for contacting Netflix This is Ronnie. How can I help?
You
Dear Ronnie, recently, I've started seeing the message "You seem to be using an unblocker or proxy. Please turn off any of these services and try again". It seems to be caused by the fact that I am using iVPN.net to secure my local uplink. Without it, my internet connection is unencrypted and everyone in my local network, including hotspot users, administrators, collegues at work, and others are able to steal my private information, spy on me and compromise my online safety. Does Netflix require that I throw my personal security to the wind for access to its services?
inarray() { local n=$1 h; shift; for h; do [[ $n = "$h" ]] && return; done; return 1; }
mapfile modules < "$FS_SRC_PATH/modules.conf"
for module in "${modules[@]}"; do
if inarray "${module##}" "${optional_modules_add[@]}"; then
[[ $use_freeswitch_optional = y ]] && echo "${module##}" || echo "#${module##}"
elif inarray "${module##}" "${freetdm_modules_add[@]}"; then
[[ use_freetdm = y ]] && echo "${module##}" || echo "#${module##}"
elif ...
else
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager willLoadStoreIsCloud:(BOOL)isCloudStore {
self.privateManagedObjectContext = nil; // 8: -1
self.mainManagedObjectContext = nil; // 9: -1
#if TARGET_OS_IPHONE
dispatch_async( dispatch_get_main_queue(), ^{
if (![self.storeLoading isVisible])
self.storeLoading = [PearlOverlay showOverlayWithTitle:@"Opening Your Data"];
} );
#!/usr/bin/env bash
for file; do
while read -r line; do
if [[ $line = "===" ]]; then
..
else
..
fi
done < "$file"
/*
===== IMPORTANT =====
This is sample code demonstrating API, technology or techniques in development.
Although this sample code has been reviewed for technical accuracy, it is not
final. Apple is supplying this information to help you plan for the adoption of
the technologies and programming interfaces described herein. This information
is subject to change, and software implemented based on this sample code should
be tested with final operating system software and final documentation. Newer
$ gs rebase
Authentication realm: <https://cocos2d-iphone.googlecode.com:443> Google Code Subversion Repository
Password for 'lhunath':
Index mismatch: 3d73f236e552682aea8fb9d95351820e12a3b678 != a19e30bfc588e42c30e527ea4445a7ed338f598b
rereading f9074f53d624b4469fa83e840f00e148c93f7cd3
D experimental/CocosDenshion/CDAudioManager.h
D experimental/CocosDenshion/CDAudioManager.mm
D experimental/CocosDenshion/CDOpenALSupport.h
D experimental/CocosDenshion/CocosDenshion.h
D experimental/CocosDenshion/CocosDenshion.mm
other: X--Y--Z
/ /
master: A-----B
Picture a file "foo" in master at A.
I branch off to other, and in X I rename "foo" to "bar".
I continue work in X and modify the contents of "bar" significantly, committing Y.
I then switch back to master and make some modifications to "foo" in A, committing them to B.
Now I want to merge those changes in B with other, creating Z.
GLfloat coordinates[] = {
0.0f, body[bodyFrame].maxT,
body[bodyFrame].maxS, body[bodyFrame].maxT,
0.0f, 0.0f,
body[bodyFrame].maxS, 0.0f
};
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
GLfloat vertices[] = {