Skip to content

Instantly share code, notes, and snippets.

View jankcat's full-sized avatar
🥝

Timothy Watkins jankcat

🥝
  • Calgary, AB
View GitHub Profile
@jankcat
jankcat / DXF-fix.md
Created November 24, 2022 18:06
Errors opening DXF files from the 80s and 90s?

If you are trying to open an AutoCAD DXF file from the late 80s or 90s and get things like "Unknown error" in Illustrator or other software, just get a blank page in AutoCAD or a generic "failed" message, try this.

Open the DXF file in your favorite text editor.

Near the top, maybe line 6 or so, find $ACADVER.

Under that, you should see 1, and then the DXF drawing database version number.

If you see something outside of the official list (http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf), it probably won't work.

@jankcat
jankcat / match.sh
Last active August 3, 2019 01:43
Match user+hash file with pass+hash file
#!/bin/bash
grep . users.txt | while read user; do
echo "$(echo $user | grep -o '^\S*' | grep -v '^$') $(cat pass.txt | grep "$(echo $user | grep -o '\s\S*' | grep -o '\S.*')" | grep -o '^\S*' | grep -v '^$' || echo -e "\033[2K\033[1A")"
done
@jankcat
jankcat / night.js
Last active May 9, 2017 21:34
fb messenger night mode
/*background*/document.getElementById("content").getElementsByTagName("div")[0].getElementsByTagName("div")[0].getElementsByTagName("div")[0].style.backgroundColor="#2E3136";/*title text*/document.getElementsByTagName("body")[0].style.color="#FFFFFF";/*text*/var node=document.createElement("style");node.innerHTML="/*new convo friend info*/._1n-e, /*new convo name*/._llq, /*new convo info*/._36zg, /*sidebar preview*/._1htf, /*link preview title*/._5i_d .__6k, /*link preview text*/._5i_d .__6l, /*link preview url*/._5i_d .__6m, /*right sidebar names*/._364g, /*right sidebar title*/em, /*right sidebar title*/._2jnv, /*sidebar names*/._1ht6, /*sidebar times*/._1ht7, /*right sidebar*/._3szq, /*chat title*/._17w2{color:rgba(255, 255, 255, 1);}/*in chat names*/._ih3, /*in chat times*/._497p{color:rgba(200, 200, 200, 1);}/*your chat bubbles*/._nd_ ._hh7, /*their chat bubbles*/._hh7, /*link preview bubbles*/._ui9, /*delete message modal*/._4eby{background-color:rgba(75, 75, 75, 1);color:rgba(255, 255, 255, 1);}";docum
@jankcat
jankcat / aftercommand
Created May 5, 2017 15:24
Current ReporterStats runner on aftercommand
{
"event": "runner:aftercommand",
"cid": "0-0",
"specs": [
"\/git\/unsorted\/wdio-example-leak\/tests\/test1.js"
],
"command": "saveDocumentScreenshot",
"args": [
"runs\/TEST1\/chrome\/native mobile\/page 1.png"
],
@jankcat
jankcat / memory-leak-log.txt
Last active April 18, 2017 22:12
wdio-memory-leak logs
Starting Tests...
․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․
<--- Last few GCs --->
[24043:0x104800000] 89502 ms: Mark-sweep 1398.2 (1447.9) -> 1398.2 (1448.4) MB, 50.5 / 0.0 ms allocation failure GC in old space requested
[24043:0x104800000] 89605 ms: Mark-sweep 1398.2 (1448.4) -> 1398.2 (1417.4) MB, 103.3 / 0.0 ms last resort
[24043:0x104800000] 89701 ms: Mark-sweep 1398.2 (1417.4) -> 1398.2 (1417.4) MB, 95.3 / 0.0 ms last resort
@jankcat
jankcat / test.js
Created March 16, 2017 19:40
Applitools Eyes with Native Promise Manager And Timeout
/* In the shell script that runs my tests: */
#Disable the Selenium Promise Manager
export SELENIUM_PROMISE_MANAGER=0
/* In my test file */
/*...getConfig into host, capabilities, key vars...*/
let driver = new webdriver.Builder().usingServer(host).withCapabilities(capabilities).build();
let eyes = new Eyes();
eyes.setApiKey(key);
/*...eyes setBatch, setDefaultMatchTimeout, setWaitBeforeScreenshots, setSaveNewTests, setStitchMode, setForceFullPageScreenshot...*/
@jankcat
jankcat / test.js
Created March 16, 2017 16:59
Applitools Eyes Problem Snippet
/*...getConfig into host, capabilities, key vars...*/
let driver = new webdriver.Builder().usingServer(host).withCapabilities(capabilities).build();
let eyes = new Eyes();
eyes.setApiKey(key);
/*...eyes setBatch, setDefaultMatchTimeout, setWaitBeforeScreenshots, setSaveNewTests, setStitchMode, setForceFullPageScreenshot...*/
eyes.open(driver, testName, testArea).then(function (driver) {
const page = new SomePage(driver, eyes);
page.open(); // basically just: function { this.driver.get('someUrl'); }
@jankcat
jankcat / example-test.js
Last active January 18, 2017 21:04
Example Mocha/BrowserStack-Local combo, that works now!
import assert from 'assert';
import test from 'selenium-webdriver/testing';
var browserstack = require('browserstack-local');
var local = new browserstack.Local();
let localOptions = {
'key': '...accessKeyHere...'
};
test.before(function(done) {
this.timeout(30000);
@jankcat
jankcat / index.js
Created December 26, 2016 17:26
React Native Stacked Round Images
/**
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,

Keybase proof

I hereby claim:

  • I am jankcat on github.
  • I am twatkins (https://keybase.io/twatkins) on keybase.
  • I have a public key whose fingerprint is 84E5 7671 F39C AD83 F5B6 1ADF 5518 7A80 5225 6840

To claim this, I am signing this object: