Skip to content

Instantly share code, notes, and snippets.

View ivanionut's full-sized avatar
🎯
Focusing

Ivan Ionut ivanionut

🎯
Focusing
View GitHub Profile
@oogali
oogali / etc-nginx-conf.d-observium.conf
Created September 10, 2015 15:42
Observium Nginx configuration
server {
listen 80;
server_name observium.yourdomain.com;
access_log /var/log/nginx/observium-access_log combined;
error_log /var/log/nginx/observium-error_log warn;
root /opt/observium/html;
client_max_body_size 10m;
client_body_buffer_size 8K;
@JamoCA
JamoCA / getMimeType.cfm
Last active September 15, 2015 16:40
Update to ColdFusion getMimeType UDF. Update struct creation & add/update mime types. Make filename optional. Passes "application/unknown" if type not found.
/* ORIGINAL: http://www.cflib.org/udf/getMimeType
Returns mime type and subtype for a file.
@param filename File name to examine. (optional)
@return Returns a string.
@author Kenneth Rainey ([email protected])
@version 1, April 21, 2004
@version 2, September 1, 2015 https://gist.github.com/JamoCA/5a2cece7e2a248f71ad9 */
function getMimeType() {
var fileExtension = "";
var mimeStruct = {"323" = "text/h323",
@JamoCA
JamoCA / GraphicsMagick.cfm
Last active March 25, 2023 08:37
ColdFusion Custom Tag for GraphicsMagick. Faster than ColdFusion's CFImage/java processing. Smaller output files. Better CMYK compatibility. Works with more image formats. (Set timout=0 to have image manipulation performed in the background; 0ms)
<CFSETTING ENABLECFOUTPUTONLY="YES">
<!---
NAME: CF_GraphicsMagick
DESCRIPTION: ColdFusion wrapper for some GraphicsMagick routines. Faster than CFImage. Generates smaller images. Better
CMYK compatilibity (Adds compatibility to CF9.)
Works with more images formats, including EPS: http://www.graphicsmagick.org/formats.html
EXAMPLES:
<CF_GraphicsMagick action="AspectScale" Infile="#ImageIn#" Outfile="#imageOut#" width="#W#" height="#H#">
@JamoCA
JamoCA / WKHTMLTOPDF.cfm
Last active December 16, 2022 04:30
WKHTMLTOPDF ColdFusion Custom Tag - Converts multiple HTML fragments to PDF.
<CFSETTING ENABLECFOUTPUTONLY="Yes">
<!--- 4/2/2015 by SunStar Media http://www.sunstarmedia.com/ --->
<!--- more posts here: https://gamesover2600.tumblr.com/tagged/wkhtmltopdf --->
<CFPARAM NAME="Attributes.wkhtmltopdfEXEPath" DEFAULT="c:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe">
<CFPARAM NAME="Attributes.ShowDebug" DEFAULT="no"><!--- Yes/No Shows inline results. (default = no) --->
<CFPARAM NAME="Attributes.DebugVar" DEFAULT="WKHMLTOPDF_Result" TYPE="variableName"><!--- Variable name w/PDF generation data. Optional --->
<CFPARAM NAME="Attributes.TimeOut" DEFAULT="60" TYPE="integer"><!--- CFExecute Timeout (Default = 60) --->
<CFPARAM NAME="Attributes.HeaderURL" DEFAULT=""><!--- Publicly accessible URL. Optional --->
<!--- TODO: Add HeaderSpacing --->
@rahul286
rahul286 / nginx-pagespeed.conf
Last active January 10, 2023 18:28
nginx + pagespeed downstream caching example
#source: http://www.jefftk.com/2014-01-03--nginx.conf
# for debugging with valgrind
#daemon off;
#master_process off;
#user nobody;
worker_processes 1;
worker_rlimit_core 500M;
@coldfumonkeh
coldfumonkeh / README.md
Last active August 29, 2015 14:14
Server Detection Scriptlet.. (WTF is a scriptlet?)

ColdFusion Server Detection

This is a re-imagineering of a ColdFusion code block found here: https://github.com/webdevsourcerer/CF-Server-Detect

It is actually originally noted as a ColdFusion Scriptlet but we have NO frickin' idea what a ColdFusion Scriptlet is (because there is no such thing).

Credits

It's ALWAYS good etiquette to credit and thank those who gave time, skills and knowledge to advance the community and help to improve shitty code.

@aubm
aubm / end of supervisord.conf
Last active August 5, 2021 11:19
Sentry configuration files example
[program:sentry-web]
directory=/www/sentry/
command=/www/sentry/bin/sentry --config=/etc/sentry.conf.py start http
autostart=true
autorestart=true
redirect_stderr=true
[program:sentry-worker]
directory=/www/sentry/
command=/www/sentry/bin/sentry --config=/etc/sentry.conf.py celery worker -B
@JamoCA
JamoCA / cfusion_encrypt.cfm
Last active January 28, 2018 16:11
ColdFusion 11 cfusion_encrypt & cfusion_decrypt function replacement (Works on ACF9-11 & Railo)
<cfscript>
/* ColdFusion 11 dropped the undocumented cfusion_encrypt & decrypt functions while Railo 4.2 still officially supports it.
This script will reestablish the built-in function. You can also use fusion_encrypt/decrypt (without the "c").
Based on 2005 blog post: http://www.barneyb.com/barneyblog/2005/10/28/cfusion_encryptcfusion_decrypt-udfs/ */
function fusion_binaryXOR(n1, n2){
n1 = formatBaseN(n1, 2);
n2 = formatBaseN(n2, 2);
return inputBaseN(replace(n1 + n2, 2, 0, "all"), 2);
}
function fusion_encrypt(string, key){
<cfscript>
/**
* Displays a formatted approximation of how long ago a timestamp was.
*
* @param input - Date to Format (required)
* @param defaultMask - the date mask if the date is earlier than the earliest case. Default dd MMM, YYYY
* @return Returns a string.
* @author Ryan Guill ([email protected]), Adam Tuttle ([email protected])
* @version 1, Sept 11, 2014