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
tell application "Safari" | |
set _source to do JavaScript "window.document.documentElement.outerHTML" in document 1 | |
set _name to name of document 1 | |
end tell | |
tell application "BBEdit" | |
make new text window with properties ¬ | |
{contents:_source, source language:"HTML", name:"Generated source: " & _name} | |
select insertion point before character 1 of text window 1 |
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> | |
// .h file | |
struct MyConstantsStruct | |
{ | |
NSString *foo; | |
NSString *bar; |
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
=== modified file 'lisp/term/ns-win.el' | |
--- old/lisp/term/ns-win.el 2011-10-01 20:32:01 +0000 | |
+++ new/lisp/term/ns-win.el 2011-11-10 16:22:51 +0000 | |
@@ -928,6 +928,10 @@ | |
(add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces)) | |
(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system)) | |
+(declare-function ns-toggle-fullscreen-internal "nsfns.m" ()) | |
+(defun ns-toggle-fullscreen () | |
+ (interactive) |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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 <objc/runtime.h> | |
@implementation NSObject (ARCZombie) | |
+ (void) load | |
{ | |
const char *NSZombieEnabled = getenv("NSZombieEnabled"); | |
if (NSZombieEnabled && tolower(NSZombieEnabled[0]) == 'y') | |
{ | |
Method dealloc = class_getInstanceMethod(self, @selector(dealloc)); |
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
#define EMKStringableEnum(ENUM_NAME, ENUM_VALUES...) \ | |
\ | |
typedef enum { \ | |
ENUM_VALUES \ | |
} ENUM_NAME; \ | |
\ | |
\ | |
\ | |
static NSString * ENUM_NAME##ToString(int enumValue) { \ | |
static NSString *enumDescription = @"" #ENUM_VALUES; \ |
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
/** | |
* @ingroup macros | |
* | |
* Call the superclass' default zero-argument initializer, returning nil if the superclass' initializer | |
* returns nil. | |
* | |
* This macro is equivalent to: | |
* | |
* @code | |
* if ((self = [super init]) == nil) |
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
// C++11 lambdas aren't terribly useful at producing art. | |
// Source below is valid C++11. VS2013 takes about a minute at it (Release config), | |
// reaches almost 4GB of memory usage and then gives a | |
// | |
// 1>ConsoleApplication1.cpp(34): fatal error C1001: An internal error has occurred in the compiler. | |
// 1> (compiler file 'msc1.cpp', line 1325) | |
// 1> To work around this problem, try simplifying or changing the program near the locations listed above. | |
// 1> Please choose the Technical Support command on the Visual C++ | |
// 1> Help menu, or open the Technical Support help file for more information | |
// 1> This error occurred in injected text: |
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
(* How do to topology in Coq if you are secretly an HOL fan. | |
We will not use type classes or canonical structures because they | |
count as "advanced" technology. But we will use notations. | |
*) | |
(* We think of subsets as propositional functions. | |
Thus, if [A] is a type [x : A] and [U] is a subset of [A], | |
[U x] means "[x] is an element of [U]". | |
*) | |
Definition P (A : Type) := A -> Prop. |
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/python | |
from urllib import quote_plus | |
from sys import stdin | |
from subprocess import call | |
import requests | |
import xml.etree.ElementTree as ET | |
appID = 'XXXXXX-YYYYYYYYYY' # Placeholder. You'll need to get an ID from http://products.wolframalpha.com/api/ |
OlderNewer