Skip to content

Instantly share code, notes, and snippets.

👨‍💻
hacking

James Treworgy jamietre

👨‍💻
hacking
View GitHub Profile
@jamietre
jamietre / .zshrc-wsl-windows-terminal
Last active Apr 19, 2020
zsh config for windows-like inline editing using Windows Terminal + wsl
View .zshrc-wsl-windows-terminal
# add this to your .zshrc
r-delregion() {
if ((REGION_ACTIVE)) then
zle kill-region
else
local widget_name=$1
shift
zle $widget_name -- $@
fi
@jamietre
jamietre / ddns_provider.conf
Last active Jun 25, 2020
Howto - using duckdns with Synology RT2600AC
View ddns_provider.conf
[DuckDNS]
modulepath=/sbin/duckddns
queryurl=duckDNS.org
View jest-log-suppressing-reporter.js
/**
* A reporter that suppresses logs for passing tests
*
* There's no direct way to do this at this point other than a custom reporter. Future
* changes may give us an option to do this without a custom reporter:
*
* https://github.com/facebook/jest/issues/4156
*
* ts-jest seems to not have registered TypeScript extension at the point the reporters are
* registered; this must be JavaScript unless we want to precompile it.
@jamietre
jamietre / gist:e031894cd689342d8ee47be132b77528
Last active Dec 27, 2017
zsh config for windows-like inline text editing in iterm2 console in MacOS X
View gist:e031894cd689342d8ee47be132b77528
# add to .zshrc
r-delregion() {
if ((REGION_ACTIVE)) then
zle kill-region
else
zle $1
fi
}
@jamietre
jamietre / pc-rules.erb
Last active Jun 11, 2020
Karabiner Elements config to map home/end keys to PC-like behavior on MacOS X
View pc-rules.erb
{
"title": "MacOS -> PC Shortcuts",
"rules": [
{
"description": "Top/bottom of document (ctrl+home/ctrl+end)",
"manipulators": [
{
"type": "basic",
"from": <%= from("home", ["command"], ["any"]) %>,
"to": <%= to([["up_arrow", ["left_command"]]]) %>,
@jamietre
jamietre / README.md
Last active Jul 23, 2017
List of "right eye first" blu ray movies
View README.md
  • Bait
  • The Chronicles of Narnia: The Voyage of the Dawn Trader
  • The Darkest Hour
  • Dolphin Tale
  • Drive Angry
  • Edge of Tomorrow
  • Ghostbusters (2016)
  • Gulliver's Travels
  • The Hobbit: An Unexpected Journey
  • The Hobbit: The Desolation of Smaug
@jamietre
jamietre / transcodemvc.bat
Last active Jul 12, 2018
Batch file for transcoding MVC 3D streams in an MKV container
View transcodemvc.bat
@ECHO OFF
rem usage: transcodemvc input output [-r] [-s]
rem -r will re-use a previously extracted elementary stream from the temp file location
rem -s will swap eyes
set TEMP_DIR=c:\temp\recodemvc
set TEMP_FILE=%TEMP_DIR%\temp_mvc.264
set PROFILE=high
set SWAP=false
@jamietre
jamietre / Microsoft.Typescript.targets
Created Apr 29, 2016
Better msbuild config for Typescript projects in Visual Studio that tries to use npm modules first
View Microsoft.Typescript.targets
<?xml version="1.0" encoding="utf-8"?>
<!--
***********************************************************************************************
Microsoft.TypeScript.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your web deploy projects from the command-line or the IDE.
This file defines the steps in the standard build process for TypeScript files.
@jamietre
jamietre / gist:5859816
Last active Dec 18, 2015
RunBuild command to invoke a build system for Sublime Text 2 (windows), see http://www.bit-101.com/blog/?p=3439
View gist:5859816
import sublime
import sublime_plugin
class RunBuildCommand(sublime_plugin.WindowCommand):
def run(self, build_system):
self.window.run_command( "set_build_system", {"file": "Packages/User/"+build_system+".sublime-build" } )
self.window.run_command( "build" )
@jamietre
jamietre / gist:4666146
Last active Dec 11, 2015
Arabic encoding test with CsQuery
View gist:4666146
[Test, TestMethod]
public void TestArabic()
{
bool done = false;
string content = null;
CQ dom;
CQ.CreateFromUrlAsync("http://www.ahram.org.eg/Stars-Arts/News/194972.aspx")
.Then(response =>
You can’t perform that action at this time.