Skip to content

Instantly share code, notes, and snippets.

View iknowkungfoo's full-sized avatar

Adrian J. Moreno iknowkungfoo

View GitHub Profile
<cfcomponent output="false" displayname="Spreadsheet Service">
<cffunction name="init" access="public" output="false" returntype="SpreadsheetService">
<cfreturn this />
</cffunction>
<cffunction name="createFromQuery" access="public" output="false" returntype="void">
<cfargument name="data" type="query" required="true" />
<cfargument name="xlsx" type="boolean" required="false" default="false" hint="File extension is xlsx (true) or xls (false)." />
<cfargument name="fileName" type="string" required="false" default="" hint="Final file name sent to the browser." />
<cfset var config = {
@iknowkungfoo
iknowkungfoo / git_quickstart.md
Last active May 26, 2022 17:02
A collection of common git commands.

Git Quick Start

Configure SSH

Create a new SSH key: ssh-keygen -t rsa

Accept default location, enter a password.

Enter file in which to save the key (/c/Users/user.name/.ssh/id_rsa):
FOO.moduleName = function () {
// Private variables, global to the module.
let fieldX; // This value will be changed.
const foo; // This value will not change.
/**
* Constructor
*/
@iknowkungfoo
iknowkungfoo / revealing_module_template.js
Last active July 20, 2021 17:52
JavaScript Revealing Module Template with jQuery setup
NameSpace.moduleName = function($) {
// Private variable, global to the module.
var _foo;
// Private variable, global to the module.
// Will represent a jQuery object.
var $_bar;
// Constructor
var init = function() {
{
"terminal.integrated.profiles.windows": {
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
@iknowkungfoo
iknowkungfoo / VSCode-Terminal-DraculaPlus-settings.json
Last active May 24, 2021 02:43
VSCode version of the iTerm2 Dracula+ color theme (https://iterm2colorschemes.com/) VSCode > Preferences > Settings > Workbench > Appearance > Color Customization - Edit in settings.json
{
"workbench.colorCustomizations": {
"terminal.background": "#212121",
"terminal.foreground": "#f8f8f2",
"terminalCursor.background": "#f8f8f2",
"terminalCursor.foreground": "#f8f8f2",
"terminal.ansiBlack": "#212121",
"terminal.ansiBlue": "#82aaff",
"terminal.ansiBrightBlack": "#626483",
"terminal.ansiBrightBlue": "#82aaff",
@iknowkungfoo
iknowkungfoo / web.config
Created February 10, 2020 03:05
IIS SQL Injection Request Filtering
<filteringRules>
<filteringRule name="SQLInjection" scanQueryString="true">
<appliesTo>
<clear />
<add fileExtension=".asp" />
<add fileExtension=".aspx" />
</appliesTo>
<denyStrings>
<clear />
<add string="@@version" />
@iknowkungfoo
iknowkungfoo / ColdFusion: Array of Structs to XML
Created June 6, 2019 15:43
ColdFusion function to convert an array of structs to proper XML.
<cffunction name="arrayOfStructsToXML" access="public" output="false" returntype="any">
<cfargument name="data" type="array" required="true">
<cfscript>
var buffer = createObject("java","java.lang.StringBuilder").init('');
var y = arrayLen(arguments.data);
var xData = "";
buffer.append('<games>');
for (local.x = 1; local.x <= local.y; local.x++) {
local.stGame = arguments.data[local.x];
buffer.append('<game>');
<cfoutput>
<cfloop from="1" to="#len(loadFields.body)#" index="q">
[#asc(mid(loadFields.body, q, 1))#]-
</cfloop>
</cfoutput>
@iknowkungfoo
iknowkungfoo / grep_emails_in_files.md
Last active December 13, 2018 22:14
This will output a list of all emails in a specific file or in a folder.

File

Find in a single file:

grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" someFile.txt

Folder