Skip to content

Instantly share code, notes, and snippets.

View michaelvillar's full-sized avatar
💭
Working on https://height.app

Michael Villar michaelvillar

💭
Working on https://height.app
View GitHub Profile
@michaelvillar
michaelvillar / Stylefile.yml
Last active July 11, 2018 08:05
Customizations for www.linkedin.com via StyleURL.
---
version: 1.0
domains:
- www.linkedin.com
url_patterns:
- www.linkedin.com/*
timestamp: '2018-07-11T08:02:24Z'
id: o0eG
redirect_url: https://www.linkedin.com
shared_via: StyleURL – import and export CSS changes from Chrome Inspector to a Gist
@michaelvillar
michaelvillar / Stylefile.yml
Created July 11, 2018 07:34
Customizations for www.height.app via StyleURL.
---
version: 1.0
domains:
- www.height.app
url_patterns:
- www.height.app/*
timestamp: '2018-07-11T07:34:28Z'
id: t9cL
redirect_url: https://www.height.app/
shared_via: StyleURL – import and export CSS changes from Chrome Inspector to a Gist
@michaelvillar
michaelvillar / .zshrc
Created August 25, 2016 00:19
Get a OS X Notification when a slow CLI command finishes
# Based on http://frantic.im/notify-on-completion and https://gist.github.com/jamesmacaulay/860763
# Notify on completion
function f_notifyme {
LAST_EXIT_CODE=$?
CMD=$(fc -ln -1)
terminal-notifier -title "$CMD" -message "Status code: $LAST_EXIT_CODE" &
}
save_preexec_time() {
export PREEXEC_CMD="$(history | tail -1 | sed 's/ *[0-9]* *//')"
<!doctype html>
<html>
<head>
<script src="https://github.com/michaelvillar/dynamics.js/releases/download/1.0.0/dynamics.js"></script>
<style>
#square {
position: absolute;
top: 50%;
left: 50%;
margin: -25px 0 0 -25px;
#include <dlfcn.h>
void OverrideForRecording() {
NSInteger (*SBSSpringBoardServerPort)() = dlsym(RTLD_NEXT, "SBSSpringBoardServerPort");
NSInteger (*SBSetShowsOverridesForRecording)(NSInteger, NSInteger) = dlsym(RTLD_NEXT, "SBSetShowsOverridesForRecording");
SBSetShowsOverridesForRecording(SBSSpringBoardServerPort(), 1);
}
require 'sinatra'
require 'stripe'
set :publishable_key, ENV['PUBLISHABLE_KEY']
set :secret_key, ENV['SECRET_KEY']
Stripe.api_key = settings.secret_key
get '/' do
erb :index
@michaelvillar
michaelvillar / gist:2344449
Created April 9, 2012 16:04
TUITextView in TUIScrollView
scrollView_ = [[TUIScrollView alloc] initWithFrame:scrollViewFrame];
textView_ = [[TUITextView alloc] initWithFrame:scrollView_.bounds];
textView_.autoresizingMask = TUIViewAutoresizingFlexibleWidth;
scrollView_.horizontalScrollIndicatorVisibility = TUIScrollViewIndicatorVisibleNever;
scrollView_.scrollEnabled = YES;
scrollView_.clipsToBounds = YES;
[scrollView_ setContentSize:textView_.bounds.size];
[scrollView_ addSubview:textView_];
diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j
index 3b560a5..8924510 100644
--- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j
+++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j
@@ -1213,7 +1213,7 @@ var supportsNativeDragAndDrop = [CPPlatform supportsDragAndDrop];
else if (type === "mousedown")
{
var button = aDOMEvent.button;
- _mouseDownIsRightClick = button == 2 || (button == 0 && modifierFlags & CPControlKeyMask);
+ _mouseDownIsRightClick = button == 2 || (CPBrowserIsOperatingSystem(CPMacOperatingSystem) && button == 0 && modifierFlags & CPControlKeyMask);
diff --git a/AppKit/CPWebView.j b/AppKit/CPWebView.j
index 38ddfb5..85fd246 100644
--- a/AppKit/CPWebView.j
+++ b/AppKit/CPWebView.j
@@ -114,6 +114,9 @@ CPWebViewScrollNative = 2;
[self setDrawsBackground:YES];
_loadCallback = function() {
+ if(_html != nil)
+ [self _load];