Skip to content

Instantly share code, notes, and snippets.

Josh Strange joshstrange

Block or report user

Report or block joshstrange

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 phoenix.ts
import log from './logger';
import {find} from 'lodash';
function move(window: Window, screen: Screen | null) {
if(window.isVisible() && screen !== null) {
window.setTopLeft({x: screen.flippedVisibleFrame().x, y: screen.flippedVisibleFrame().y});
}
}
function moveAndFull(window: Window, screen: Screen | null) {
@joshstrange
joshstrange / patch-ionic-angular.js
Created Jul 5, 2019
Patch ionic angular to fix swipe back issue
View patch-ionic-angular.js
/* tslint:disable */
var fs = require('fs');
let filePath = './node_modules/@ionic/angular/dist/fesm5.js';
let monkeyPatch = `// Start monkey patching
StackController.prototype.startBackTransition = function () {
return __awaiter(this, void 0, void 0, function () {
var leavingView, views, enteringView_1;
var _this = this;
return __generator(this, function (_a) {
@joshstrange
joshstrange / unraid-usb-backup.js
Created Jun 25, 2019
Backup your Unraid USB remotely. Just replace the hostname, username, password at the top of the file with your info, make sure `request` and `request-promise-native` are installed and then just run it with `node index.js`
View unraid-usb-backup.js
const request = require('request-promise-native');
const fs = require('fs');
let hostname = 'http://unraid-url.com';
let username = 'root';
let password = 'mypassword';
(async () => {
// Get CSRF Token
@joshstrange
joshstrange / fetchGraphQLSchema
Created Jun 26, 2018
Fetch graphql schema and save to file
View fetchGraphQLSchema
#!/usr/bin/env node
const os = require('os');
const request = require('request-promise-native');
const fs = require('mz/fs');
let hostname = os.hostname();
let baseUrl = 'YOUR_BASE_URL';
(async () => {
let jwt = await getJwt();
@joshstrange
joshstrange / Xiaomi.pm
Created Apr 28, 2018
Control script for Xiaomi Dafang
View Xiaomi.pm
package ZoneMinder::Control::Xiaomi;
use 5.006;
use strict;
use warnings;
require ZoneMinder::Base;
require ZoneMinder::Control;
our @ISA = qw(ZoneMinder::Control);
@joshstrange
joshstrange / gitlab-ci.yaml
Created Oct 14, 2017
Gitlab CI Config for Fastlane
View gitlab-ci.yaml
stages:
- beta
variables:
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
test_flight_build:
dependencies: []
stage: beta
@joshstrange
joshstrange / Fastfile
Last active Jun 30, 2019
Fastfile for iOS/Android
View Fastfile
# Customise this file, documentation can be found here:
# https://docs.fastlane.tools/actions/
# All available actions: https://docs.fastlane.tools/actions
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
@joshstrange
joshstrange / add_target_attributes_and_push_notification_cap.js
Created Oct 14, 2017
Add target attributes and push notification cap Cordova Hook
View add_target_attributes_and_push_notification_cap.js
module.exports = function(context) {
var fs = require('fs');
var ROOT_DIR = context.opts.projectRoot;
if(ROOT_DIR.substr(0, 1) === '/' && fs.existsSync(ROOT_DIR + "/platforms/ios")) {
var srcFile = ROOT_DIR + "/platforms/ios/My App.xcodeproj/project.pbxproj";
var projectPbxproj = fs.readFileSync(srcFile, "utf8");
@joshstrange
joshstrange / closest.go
Created Oct 1, 2016
Docker-gen Closest
View closest.go
package main
import (
"strings"
"fmt"
)
func arrayClosest(values []string, input string) string {
best := ""
View gist:f28e324cdfdc39b116a6
Verifying I am +joshstrange on my passcard. https://onename.com/joshstrange
You can’t perform that action at this time.