start new:
tmux
start new with session name:
tmux new -s myname
| #import <UIKit/UIKit.h> | |
| #import <ImageIO/ImageIO.h> | |
| #import <MobileCoreServices/MobileCoreServices.h> | |
| static UIImage *frameImage(CGSize size, CGFloat radians) { | |
| UIGraphicsBeginImageContextWithOptions(size, YES, 1); { | |
| [[UIColor whiteColor] setFill]; | |
| UIRectFill(CGRectInfinite); | |
| CGContextRef gc = UIGraphicsGetCurrentContext(); | |
| CGContextTranslateCTM(gc, size.width / 2, size.height / 2); |
| #import <Foundation/Foundation.h> | |
| @interface NSBundle (TTTOverrideLanguage) | |
| + (void)ttt_overrideLanguage:(NSString *)language; | |
| + (void)ttt_resetLanguage; | |
| @end |
| # alias to edit commit messages without using rebase interactive | |
| # example: git reword commithash message | |
| reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f" | |
| # completely wipe git history | |
| wipe-history = "!f() { git add . && git reset --soft $(git rev-list --max-parents=0 HEAD) && git commit --amend -m \"${1:-sup}\" && git push --force; }; f" | |
| # squash the last N commits | |
| squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f" |
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.
gituser via Diskstation interface (with File Station and WebDAV privilages)git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.| // | |
| // Queue.swift | |
| // NTBSwift | |
| // | |
| // Created by Kåre Morstøl on 11/07/14. | |
| // | |
| // Using the "Two-Lock Concurrent Queue Algorithm" from http://www.cs.rochester.edu/research/synchronization/pseudocode/queues.html#tlq, without the locks. | |
| // should be an inner class of Queue, but inner classes and generics crash the compiler, SourceKit (repeatedly) and occasionally XCode. |
| import AVFoundation | |
| import Foundation | |
| // The maximum number of audio buffers in flight. Setting to two allows one | |
| // buffer to be played while the next is being written. | |
| private let kInFlightAudioBuffers: Int = 2 | |
| // The number of audio samples per buffer. A lower value reduces latency for | |
| // changes but requires more processing but increases the risk of being unable | |
| // to fill the buffers in time. A setting of 1024 represents about 23ms of |
| SWIFT_INCLUDE_PATHS = $(SRCROOT) |
| SELECT pods.name, stats_metrics.download_total, stats_metrics.download_week, stats_metrics.app_total, stats_metrics.app_week FROM stats_metrics JOIN pods ON stats_metrics.pod_id = pods.id ORDER BY app_total DESC LIMIT 300; |