View gist:a3c889fcde090e59e083
1 2 3 4 5 6 7 8 9 10
#define SWIZZLE_ADD_ANIMATION 0
 
#if DEBUG && SWIZZLE_ADD_ANIMATION
 
+ (void)load {
safe_swap_implementation(self, @selector(addAnimation:forKey:), @selector(bb_addAnimation:forKey:));
}
 
- (void)bb_addAnimation:(CAAnimation *)animation forKey:(NSString *)key {
// Ignore the stupid phantom text field's cursor animation
View DiagnosticMessagesHistory.plist
1 2 3 4 5 6 7 8 9 10
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AutoSubmit</key>
<true/>
<key>AutoSubmitVersion</key>
<integer>4</integer>
<key>ThirdPartyDataSubmit</key>
<true/>
View notify
1 2 3 4 5
notify() {
body=${1-'Demo notification\nsyntax: notify "title" "body"'}
title=${2-'Terminal notification'}
osascript -e "display notification \"${body//\"/\\\"}\" with title \"${title//\"/\\\"}\""
}
View persistence.py
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env python3
 
"""
Simple script to maintain persistence between a local file system and an S3 bucket using the s3cmd commandline tool
and asyncio's event loop. A better version of this would likely use the Python Boto library and walk the file system
itself. This will run a job every five minutes using the s3cmd client to synchronize a local file system
with S3. This is meant to be run in a Docker volume container. This is NOT meant to store things such as database
files, etc. A better alternative is likely S3Fuse however that project is old and requires privileged access to
the Docker host.
"""
View myapp.tf
1 2 3 4 5 6 7 8 9 10
variable "aws_access_key" {
description = "The AWS_ACCESS_KEY_ID to use"
}
 
variable "aws_secret_key" {
description = "The AWS_SECRET_ACCESS_KEY to use"
}
 
provider "aws" {
access_key = "${var.aws_access_key}"
View howto-stream-tmux-session-in-realtime-over-http.md

On the server with tmux

Create a new tmux session:

tmux new-session -s my-session # launch `top`, `htop`, or anything that will regularly updates, then detach

Stream your session:

View loading_patterns.js
1 2 3 4 5 6 7 8 9
//steal
steal('a', 'b', function(a, b) { return ; });
 
//amd
define(['a', 'b'], function(a, b) { return ; });
 
//requirejs
require(['a'], function(a) {});
define(['a', 'b'], function(a, b) { return ; });
View UIView+Orientation.h
1 2 3 4 5 6 7 8 9 10
//
// UIView+Orientation.h
//
 
#import <UIKit/UIKit.h>
 
// These macros should only be used if you MUST know the interface orientation for the device itself, for example when displaying a new UIWindow.
// This should be very rare; generally you should only look at the immediate parent view's size (or "view orientation" using the category below).
#define StatusBarOrientationIsPortrait UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])
#define StatusBarOrientationIsLandscape UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])
View gist:cfa3c6d009e85a0c78d0
1 2 3 4 5 6 7 8 9 10
<VirtualHost 10.248.206.19:80>
ServerName some.domain.com
 
ProxyRequests Off
ProxyPreserveHost On
 
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
View interact.cpp
1 2 3 4 5 6 7 8 9 10
// Пример применения иерархии классов для отладки интерактивной задачи
// (C) Петр Калинин, GNU GPL :)
 
// Достоинства подхода, приведенного ниже, состоят в следующем:
// - Для использования другого "интерактора" надо просто закомментировать
// одну и раскомментировать другую строчку
// - Можно в одной программе иметь много "интеракторов" и переключаться между ними как надо,
// не боясь запутаться
// - Все переменные, относящиеся к внутренностям "интерактора", можно держать внутри
// класса и не захламлять глобальное пространство
Something went wrong with that request. Please try again.