#Mac OS X
| from: http://www.meandmark.com/keycodes.html | |
| with some additions from people in the comments, thanks :) | |
| Virtual Keycodes for the Mac QWERTY Layout | |
| Keycodes are in hexadecimal. A blank entry means either there is no key assigned to that keycode or I was unable to find the assigned key. | |
| Keycode Key | |
| 0x00 A | |
| 0x01 S | |
| 0x02 D |
| function DrawingProxy(ctx){ | |
| "use strict"; | |
| setContext(ctx); | |
| var lastMethod, History, slice=Array.prototype.slice; | |
| Object.defineProperty(Main,"context",{get : function(){return ctx}, set : setContext}); | |
| Object.defineProperty(Main,"$",{get : $}); |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| var server=require('websocket.js').createServer(); | |
| var chatroom=server.addApp('/chatroom'); | |
| chatroom.ondata=function(data,userName){ | |
| this.broadcast(data,userName); | |
| } | |
| chatroom.onclose=function(userName){ | |
| this.broadcast(userName+" disconnected."); |
When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.
In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:
| var util = {}; | |
| /** | |
| * IE8 compatible custom event listener | |
| * @method listenToCustomEvents | |
| * @param {string} eventName Event to listen for | |
| * @param {method} callback Method to run on event | |
| */ | |
| util.listenToCustomEvents = function (event_name, callback) { | |
| if (document.addEventListener) { |
| require 'oauth2' | |
| class WelcomeController < ApplicationController | |
| # You need to configure a tenant at Azure Active Directory(AAD) to register web app and web service app | |
| # You will need two entries for these app at the AAD portal | |
| # You will put clientid and clientsecret for your web app here | |
| # ResourceId is the webservice that you registered | |
| # RedirectUri is registered for your web app | |
| CLIENT_ID = 'b6a42...' | |
| CLIENT_SECRET = 'TSbx..' |
| #!/usr/bin/env ruby | |
| # A sneaky wrapper around Rubocop that allows you to run it only against | |
| # the recent changes, as opposed to the whole project. It lets you | |
| # enforce the style guide for new/modified code only, as opposed to | |
| # having to restyle everything or adding cops incrementally. It relies | |
| # on git to figure out which files to check. | |
| # | |
| # Here are some options you can pass in addition to the ones in rubocop: | |
| # |