This is intended to be a useful reference for any AutoHotkey scriptwriter regardless of their experience. If you find any of the examples to be confusing please let me know so I can update them for clarity.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {withAppBuildGradle} = require('@expo/config-plugins') | |
/** | |
* A Config Plugin to disable bundle compression in Android build.gradle. | |
* This makes the Android app start faster - in our tests by 400ms! | |
* @param {import('@expo/config-plugins').ConfigPlugin} config | |
* @returns {import('@expo/config-plugins').ConfigPlugin} | |
*/ | |
module.exports = function withNoBundleCompression(config) { | |
return withAppBuildGradle(config, androidConfig => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect, useCallback } from "react"; | |
import { Platform } from "react-native"; | |
import * as VideoThumbnails from "expo-video-thumbnails"; | |
import { Image } from "@showtime-xyz/universal.image"; | |
import Spinner from "@showtime-xyz/universal.spinner"; | |
import { View } from "@showtime-xyz/universal.view"; | |
interface VideoThumbnailProps { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A collection of lighting effects that runs asynchronously on Philips Hue rooms/groups. | |
Pyscript must be configured to expose the "hass" global variable and allow all imports | |
so that we can access the Hue bridge configs and entity registry. | |
""" | |
import heapq | |
import logging | |
import random | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat -n .zsh_history | sort -t ';' -uk2 | sort -nk1 | cut -f2- > .zhistory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Script to Initialize my custom powershell setup. | |
.DESCRIPTION | |
Script uses scoop | |
.NOTES | |
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted. | |
Author: Mike Pruett | |
Date: October 18th, 2018 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import BoundedSemaphore | |
from concurrent.futures import ProcessPoolExecutor | |
class MaxQueuePool: | |
"""This Class wraps a concurrent.futures.Executor | |
limiting the size of its task queue. | |
If `max_queue_size` tasks are submitted, the next call to submit will block | |
until a previously submitted one is completed. |
Zach Caceres
Javascript does not have the typical 'private' and 'public' specifiers of more traditional object oriented languages like C# or Java. However, you can achieve the same effect through the clever application of Javascript's function-level scoping. The Revealing Module pattern is a design pattern for Javascript applications that elegantly solves this problem.
The central principle of the Revealing Module pattern is that all functionality and variables should be hidden unless deliberately exposed.
Let's imagine we have a music application where a musicPlayer.js file handles much of our user's experience. We need to access some methods, but shouldn't be able to mess with other methods or variables.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Exponent from 'exponent'; | |
import React from 'react'; | |
import { range } from 'lodash'; | |
import { | |
StyleSheet, | |
Dimensions, | |
ScrollView, | |
Animated, | |
Text, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sorts an array of objects In-Place, | |
* sorting by multiple fields sequentially. | |
* | |
* @description This function is meant to be used | |
* with arrays of objects, AND when you need to set | |
* multiple sorting criteria. For other cases it is | |
* recommended to use the native method `array.sort(callback)` | |
* since for simple cases this function is more expensive | |
* in time and memory. |
NewerOlder