Skip to content

Instantly share code, notes, and snippets.

View bardware's full-sized avatar

Bernhard Döbler bardware

View GitHub Profile
@bardware
bardware / clear_pac.sh
Created March 1, 2019 16:43
Clear pacman cache
You can also define how many recent versions you want to keep. To retain only one past version use:
# paccache -rk1
Add the u switch to limit the action of paccache to uninstalled packages. For example to remove all cached versions of uninstalled packages, use the following:
# paccache -ruk0
@bardware
bardware / tz.001.cfm
Created August 22, 2018 17:44
Timezone list
<cfset oZoneId = createObject( "java", "java.time.ZoneId")>
<cfset oInstant = createObject( "java", "java.time.Instant")>
<cfset oTextStyle = createObject( "java", "java.time.format.TextStyle")>
<cfset oLocale = createObject( "java", "java.util.Locale").init( getLocale() )>
<cfset qryTZ = queryNew(
"offset,zone,region,displayfull,displayfullstdo,displaynarrow,displaynarrowstdo,displayshort,displayshortstdo,displayfulloffset,displayshortoffset",
"Integer,VarChar,VarChar,VarChar,VarChar,VarChar,VarChar,VarChar,VarChar,VarChar,VarChar"
)>
<!---
http://teratech.com/is-lucee-cfml-now-better-than-adobe-coldfusion/
--->
<cfscript>
data={
boolean:true,
stringTrue:'true',
stringYes:'yes',
number:5,
stringFive:'5'
@bardware
bardware / EncodeRFC3986.cfm
Last active July 20, 2018 15:41 — forked from Leigh-/EncodeRFC3986.cfm
Comparison of EncodeForURL, URLEncodedFormat and EncodeRFC3986 (UDF)
<cfscript>
/**
* URI encoding per RFC 3986, which has treats the following as unreserved: ALPHA / DIGIT / "-" / "." / "_" / "~"
* @text Text to encode
* @returns URI encoded text
*/
public function encodeRFC3986(required string text) {
// Requires CF10+
Local.encoded = encodeForURL(arguments.text);
// Reverse encoding of tilde "~"
@bardware
bardware / mailSpoolService.cfm
Created July 10, 2018 13:42
restartColdFusion Mail-Spooler
<!---
https://plus.google.com/+JustinCookie/posts/CSj9HVoRTcY
--->
<cfscript>
sFactory = CreateObject("java", "coldfusion.server.ServiceFactory");
sFactory.mailSpoolService.stop()';
sFactory.mailSpoolService.start();
</cfscript>
@bardware
bardware / leeg.cfm
Last active May 9, 2018 22:42
look at this code on http://cflive.net/
<!---
http://cflive.net/
https://trycf.com/scratch-pad/gist/b53c961633fabec3634b7a68a88b700c
--->
<cfscript>
stAnswer = {
givenAnswer = "no"
};
writeOutput(stAnswer.givenAnswer ?: "leeg");
{
"telemetry.enableTelemetry": false,
"telemetry.enableCrashReporter": false,
"editor.fontSize": 12,
"editor.fontLigatures": true,
"editor.fontFamily": "Fira Code",
"editor.cursorStyle": "line",
"editor.rulers": [
80,
120
<cfset oJSOUP = CreateObject("java", "org.jsoup.Jsoup" )>
<cfset oJSOUPWL = CreateObject("java", "org.jsoup.safety.Whitelist" ).init()>
<cfdump var="#oJSOUP#" expand="false">
<cfdump var="#oJSOUPWL#" expand="false">
<cfdump var="#oJSOUPWL.relaxed()#" expand="false">
<cfdump var="#oJsoup.clean('<a href="link.html"><img src="http://example.com/bild.gif"></a>', oJSOUPWL.relaxed().addAttributes("a", ["href", "class"] ).addAttributes("img", ["src", "class", "styles", "width", "height"] ).removeProtocols("a", "href", ["ftp", "http", "https", "mailto"]).removeProtocols("img", "src", ["http", "https"]) )#">
<cfdump var="#oJsoup.clean('<a href="link.html"><img src="http://example.com/bild.gif"></a>', "http://example.com/", oJSOUPWL.relaxed().preserveRelativeLinks(true))#">
@bardware
bardware / dafuq.txt
Last active April 5, 2018 22:20
Was das?
̶𝕭̶̶ 𝖗̶̶ 𝖆̶̶ 𝖚̶̶ 𝖓̶̶ 𝖐̶̶ 𝖔̶̶ 𝖍̶̶ 𝖑̶̶ 𝖊̶
http://qaz.wtf/u/convert.cgi?text=Braunkohle
@bardware
bardware / box.log
Created March 23, 2018 11:01
Commandbox variable [NEWCONTENT] doesn't exist
CommandBox:stmelfposy> utils normalize-line-endings *.txt --type windows
Confirm normalizing line endings for 179 files : y
ERROR (3.9.2+00826)
variable [NEWCONTENT] doesn't exist
C:\Users\bddoeble\.CommandBox\cfml\system\modules_app\utils-commands\commands\utils\normalize-line-endings.cfc: line 95
93: }
94:
95: if ( content != newContent ) {