Skip to content

Instantly share code, notes, and snippets.

Carlin Scott carlin-q-scott

Block or report user

Report or block carlin-q-scott

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Node.targets
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputWebroot>$(TargetDir)</OutputWebroot>
</PropertyGroup>
<ItemGroup>
<gruntInputs Include="Gruntfile.js"/>
<gruntInputs Include="app/**/*.js"/>
<gruntInputs Include="app/**/*.html"/>
<gruntInputs Include="content/**/*"/>
@carlin-q-scott
carlin-q-scott / pandora-next-track.js
Last active Apr 14, 2016
Method for notifying user of new tracks on Pandora.com
View pandora-next-track.js
function notifyNewTrack(mutation){
new Notification("Now Playing", {
body: document.querySelector('.trackData').innerText
})
}
Notification.requestPermission() //normally you'd handle the response and accept rejection but whatev's.
var currentTrackObserver = new MutationObserver(notifyNewTrack)
currentTrackObserver.observe(document.querySelector('#trackInfoContainer'), {
@carlin-q-scott
carlin-q-scott / keycodeCaptor.js
Last active Jun 28, 2016
Detect Media Key events on MacOSX
View keycodeCaptor.js
/*jshint moz: true, undef: true, unused: true */
/*global ctypes, require, console, exports */
let { Cu } = require('chrome');
let { setTimeout } = require('sdk/timers');
Cu.import('resource://gre/modules/ctypes.jsm');
var objc = ctypes.open(ctypes.libraryName('objc'));
var is64bit = ctypes.voidptr_t.size == 4 ? false : true;
@carlin-q-scott
carlin-q-scott / remove-google-hangouts-links.js
Last active Feb 4, 2017
WIP: This will remove Google Hangouts links from Google pages so that you can use your own dialer
View remove-google-hangouts-links.js
View ActionFluentAssertions.cs
/// <summary>
/// Note that if this is the end of your assertion chain then append () or .Invoke() to the end
/// </summary>
/// <param name="action"></param>
/// <param name="time"></param>
/// <param name="precision"></param>
/// <returns></returns>
public static Action ShouldTakeCloseTo(this Action action, TimeSpan time)
{
View GetDomainAccountCredentials.ps1
$credential = $Host.ui.PromptForCredential("Need your domain account credentials", "Please enter your domain user name and password", $null, "NetBiosUserName")
# use -Credential $credential for some of the powershell commandlets. Copy-Item takes in this param but can't use it.
View GitBranchFromTag.sh
# Problem: Build servers check out tags to build them but we need to deploy our code based on the branch the code came from.
# Solution: Get branches containing the tag, figure out which one has the tagged commit as its head
$ git branch --contains tags/some-tag
* (HEAD detached at some-tag)
demo/carlin
demo/steve
$ git diff --shortstat demo/steve some-tag
@carlin-q-scott
carlin-q-scott / .travis.yml
Created Feb 9, 2017
travis-ci build for firefox add-ons
View .travis.yml
language: node_js
node_js:
- "stable"
env:
global:
- DISPLAY=:99.0
- FIREFOX_BIN=./firefox/firefox
- JPM_FIREFOX_BINARY=./firefox/firefox
@carlin-q-scott
carlin-q-scott / Enum.js
Created Oct 10, 2018
Attempt at creating an enum using Proxy and Class
View Enum.js
class Enum extends Proxy {
constructor(...names) {
let members = Object.create(null);
members.tryParse = name => {
if (!members[name]) {
throw new Error(`Unable to parse '${name}' as an Enum member.`);
}
return members[name];
};
@carlin-q-scott
carlin-q-scott / docker-relay.sh
Last active Nov 17, 2018 — forked from jwilson8767/install_WSL_docker.sh
Docker or Docker Toolbox for Windows and Windows Subsystem for Linux (aka Bash on Windows)
View docker-relay.sh
#!/bin/sh
exec socat UNIX-LISTEN:/var/run/docker.sock,fork,group=docker,umask=007 EXEC:"npiperelay.exe -ep -s //./pipe/docker_engine",nofork
You can’t perform that action at this time.