Skip to content

Instantly share code, notes, and snippets.

View joshstrange's full-sized avatar

Josh Strange joshstrange

View GitHub Profile
@joshstrange
joshstrange / clickupRemainingTime.js
Last active September 14, 2023 17:47
Get total of time estimates for subtasks in ClickUp
/**
* By default, ClickUp shows the total time estimate for a list of subtasks
* but does not filter out "Completed" tasks (or any other status you might
* want to not count, such as "Ready for QA"). This script will find the total
* time estimate for all subtasks that are not "Completed" or "Ready for QA".
*
* The "Ready for QA" status is a custom status that we use to indicate that
* a task is ready for QA. It is not a default status. We are filtering it out
* based on it's color 'rgb(175, 126, 46)`, if you don't use custom statuses
* then you can probably use this script as-is since it will never match. If you
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 July 5, 2019 14:22
Patch ionic angular to fix swipe back issue
/* 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 June 25, 2019 23:51
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`
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 June 26, 2018 18:36
Fetch graphql schema and save to file
#!/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 April 28, 2018 14:06
Control script for Xiaomi Dafang
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 October 14, 2017 22:54
Gitlab CI Config for Fastlane
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 November 4, 2024 05:45
Fastfile for iOS/Android
# 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 October 14, 2017 22:32
Add target attributes and push notification cap Cordova Hook
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 October 1, 2016 17:30
Docker-gen Closest
package main
import (
"strings"
"fmt"
)
func arrayClosest(values []string, input string) string {
best := ""