This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import with_statement | |
import inspect | |
class Test(object): | |
def __init__(self, name): | |
self.name = name | |
def __enter__(self): | |
return self | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Resize a UIButton according to its title's length. | |
CGSize stringSize = [self.myButton.titleLabel.text sizeWithFont:self.myButton.titleLabel.font]; | |
CGRect frame = self.myButton.frame; | |
frame.size.width = stringSize.width; | |
[self.myButton setFrame:frame]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Source: https://gist.github.com/jordan-brough/48e2803c0ffa6dc2e0bd | |
# See also: https://stackoverflow.com/a/25095062/58876 | |
# Download this script as "git-recent" (no extension), chmod it to be executable and put it in your | |
# path somewhere (e.g. /usr/bin). You can then use it via `git recent` from inside any git repo. | |
# Examples: |
Undo/Redo is one of those features of an application that you almost always need to have if you are building serious GUI tools for people to do work.
The best way to look at undo/redo is two stacks of operations the user has performed:
- The Undo stack is the "history" of what they've done
- The redo stack is the breadcrumbs back to the initial state before they started undoing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### First we build from scratch ... | |
####################################### | |
akesterson@akesterson-pc:~/source/upstream/git/akesterson/piquant$ make clean all | |
rm -f boot.bin asm/*o src/*o | |
bcc -ansi -3 -c -o src/kernel.o src/kernel.c | |
ld86 -T0x1000 -M -o kernel.bin src/kernel.o | |
kernel _printString 0 0000101b R | |
kernel _main 0 00001049 R | |
kernel _printChar 0 00001000 R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <Cocoa/Cocoa.h> | |
#import <unistd.h> | |
BOOL copy_to_clipboard(NSString *path) | |
{ | |
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage | |
NSImage * image; | |
if([path isEqualToString:@"-"]) | |
{ | |
// http://caiustheory.com/read-standard-input-using-objective-c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [[87283, 1442412746, 18052, ["hincrby", "191320:2015-09-16", "2015-09-16T13:39:00.000Z", "1"]], [87282, 1442411252, 22037, ["setex", "sifi_session:da34d588e031730b84a0462538022c60", "604800", "\u0004\b{\u0000"]], [87281, 1442410521, 81575, ["scan", "0", "MATCH", "CampaignStatistic:*", "COUNT", "1000"]], [87280, 1442409284, 12309, ["hincrby", "167569:2015-09-16", "2015-09-16T12:57:00.000Z", "1"]], [87279, 1442409279, 11073, ["hincrby", "163562:2015-09-16", "2015-09-16T12:55:00.000Z", "1"]], [87278, 1442409206, 14440, ["hincrby", "163558:2015-09-16", "2015-09-16T12:40:00.000Z", "1"]], [87277, 1442409198, 14750, ["hincrby", "187840:2015-09-16", "2015-09-16T12:34:00.000Z", "1"]], [87276, 1442409180, 11376, ["hincrby", "127478:2015-09-16", "2015-09-16T12:07:00.000Z", "1"]], [87275, 1442405559, 18445, ["hincrby", "182934:2015-09-16", "2015-09-16T11:13:00.000Z", "1"]], [87274, 1442405558, 57467, ["hincrby", "17342:2015-09-16", "2015-09-16T11:03:00.000Z", "1"]]] | |
require 'redis' | |
class Entry | |
attr_reader :log_numbe |
- Visit this website and get an OAuth Token for your Twitch account.
- Add a server to your IRC client with this configuration, using your OAuth Token as the server password. Make sure it is not using SSL.
{
address = "irc.twitch.tv";
chatnet = "Twitch";
Directly from CLI
alias x='exit'
funcsave x
or create a file in
~/.config/fish/functions
with name
OlderNewer