- Generate the file:
$ awk 'BEGIN { for(c=0;c<10000000;c++) printf "<p>LOL</p>" }' > 100M.html
$ (for I in `seq 1 100`; do cat 100M.html; done) | pv | gzip -9 > 10G.boomgz
- Check it is indeed good:
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
<cfscript> | |
numeric function getActiveThreadCount() hint="I return quantity of active requests (not including cf-threads)" { | |
local.threadCount = javacast("int", 0); | |
local.thread = createobject("java","java.lang.Thread"); | |
local.stackTrace = local.thread.getAllStackTraces(); | |
local.stackArray = local.stackTrace.entrySet().toArray(); | |
for (local.stackIndex=1; local.stackIndex < arrayLen(local.stackArray); local.stackIndex+=1){ | |
try{ | |
local.thisThread = local.stackArray[local.stackIndex].getValue(); | |
for (local.threadIndex=1; local.threadIndex < arrayLen(local.thisThread); local.threadIndex+=1){ |
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
<cfscript> | |
/* 20210301 ArrayFirstDefined: Returns first "defined" array item | |
TryCF: https://www.trycf.com/gist/9bac4917179a3e44a542bc4768a95a31 | |
Twitter: https://twitter.com/gamesover/status/1366439036903120897 | |
ACF: Requires CF2018+ to use arrayFirst(). | |
Lucee CFML: Reproted arrayFirst() bug. https://luceeserver.atlassian.net/browse/LDEV-3319 */ | |
any function arrayFirstDefined(required array array, any fallbackValue="") output=false hint="Returns first defined array item" { | |
for (local.item in arguments.array){ | |
if (not isNull(local.item)) return local.item; | |
} |
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
<cfscript> | |
/* 20200121 ColdFusion / CFML UDF to determine if request/content has been flushed using CFFlush or by exceeding max buffer. */ | |
boolean function isFlushed(){ | |
var response = false; | |
var headers = {}; | |
if (StructKeyExists(request, "isFlushedAlready") AND isValid("boolean", request.isFlushedAlready) and request.isFlushedAlready){ | |
return true; | |
} | |
headers = GetHttpRequestData(false).headers; | |
if (StructKeyExists(headers, "Expect") or not len(CGI.HTTP_Connection)){ |
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
component | |
output = false | |
hint = "I provide a super simple wrapper around getting and returning Redis resources." | |
{ | |
/** | |
* I initialize the Redis resource wrapper using Jedis 3.3.0. | |
*/ | |
public void function init() { |
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
<cfscript> | |
/* 10/26/2020 Returns a query with execution stack containing line, parent, template, function and totaltime. | |
Requires debugging to be enabled. If debugging is not enabled, an empty query is returned | |
Inspired by combination of scripts here https://www.bennadel.com/blog/116-finding-template-execution-stack-in-coldfusion.htm | |
If desired, replace encrypted "WEB-INF/debug/classic.cfm" template with empty script (or edit from https://github.com/joshknutson/coldfusion-debug ) */ | |
query function getTemplatesUsed() output="false" hint="Returns query with execution stack: line, parent, template, function and totaltime." { | |
var temp = {r=0, re = "\|(.*?)(\(|\])" }; | |
var objFactory = CreateObject("java", "coldfusion.server.ServiceFactory"); | |
var st = CreateObject("java", "java.lang.String"); | |
var objDebugging = objFactory.GetDebuggingService(); |
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
#!/bin/bash | |
set -e | |
for field in $(cat /proc/cmdline); do | |
if [[ "${field}" = root=* ]]; then | |
UUID=$(echo $field | awk -F= '{print $3}') | |
break | |
fi | |
done |
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
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
target="${1:-/opt/sublime_merge/sublime_merge}" | |
check_sha() { | |
local sha_valid |
This gist will no longer be updated as the changelog will be on the official website.
- Sublime Text/Merge Official Discord chat server: https://discord.gg/D43Pecu
- Sublime Text/Merge 中文 Telegram 交流群組: https://t.me/sublime_tw
Converted via https://domchristie.github.io/turndown
NewerOlder