Skip to content

Instantly share code, notes, and snippets.

View cocolote's full-sized avatar
💭
Working on Chromebook

Ezequiel Jose Lopez cocolote

💭
Working on Chromebook
View GitHub Profile
@cocolote
cocolote / CF-Queries.md
Last active April 4, 2024 15:54
Cold Fusion Queries Cheat sheet

#ColdFusion Queries

To interact with a database with CFML first you need to setup the data source in the administrator site.

The table that I'm usign in this examples

####----TestTable-----

id myDataAlfa myDataInt
@cocolote
cocolote / coldfusion_cheatsheet.md
Last active May 3, 2023 10:24
ColdFusion cheatsheet

The ColdFusion Basics

Set variables

  • Current time
<cfset currentTime = now() />
  • Regular string
@cocolote
cocolote / linux_cheetsheet.sh
Last active December 24, 2021 05:07
Linux command line cheatsheet
# SED = TEST SQL QUERIES SYNTAX
# =============================
# Takes the table name and the WHERE clause to create a SELECT query with this values.
## UPDATE queries
sed 's|update\s\+\([A-Z0-9_]\+\).\+\(where\s\+.\+$\)|SELECT * FROM \1 \2|i' <text file with queries>
### example: UPDATE table_2 SET filed_1 = '123ab', field_2 = 123 WHERE field_3 = 'bla' and field_5 like '%lala'
### output example: SELECT * FROM table_2 WHERE field_3 = 'bla' and field_5 like '%lala'
## DELETE queries
@cocolote
cocolote / CF-XML.md
Last active December 14, 2020 16:25
XML and CFML

#Working with XML in ColdFusion

Cheatsheet with code examples to read, create and search xml files

ColdFusion provides many built-in functions for doing all sort of XML based operations.

###Reading XML Document Read the document then passes it to the parser to create an XML object

<cffile action="read" file="#ExpandPath('./some.xml')#" variable="myXML" />
<cfset myDoc=XmlParse(myXML) />
@cocolote
cocolote / debug-phone-web-app.md
Created May 21, 2017 16:32
steps to debug a web phone app

Debug Javascript mobile web app (linux)

  1. Plug your phoen with the USB cable to your computer
  2. Run usbmuxd with sudo

$ sudo usbmuxd

  1. Run idevice_id -l to check if the phone is reachable

$ idevice_id -l

@cocolote
cocolote / JSON-CFML.md
Created July 15, 2015 14:31
JavaScript Object Notation JSON and ColdFusion

#JavaScript Object Notation (JSON) and CFML

###Creating JSON object

As you probably guessed JSON objects can be created from cf structures

<cfset myStruct = {
	items: {
		item1: {name: 'item1', price: 1000},
 item2: {name: 'item2', price: 12.50},
@cocolote
cocolote / VIM-cheatsheet.md
Last active August 29, 2015 14:25
A reference with the basic commands for VIM

#Vim Basic Commands

###Modes i: change to insert mode to edit text v: change to visual mode to select text Esc: Normal mode to navigate through the text file

###Moves (Normal mode) h: move left | l: move right j: move up | k: move down

@cocolote
cocolote / apache-installation.md
Last active August 29, 2015 14:24
Apache Installation

#Install Apache server on Windows 7 64 with IIS running

Check first if you have the dependencies installed in your computer. You need Visual C++ 2008 Redistributable Package Open the control panel (window+r type "control" and press "enter") check if you see the package installed.

Get the Apache .zip. This is and official third party site, Apache does not provide a package to install in windows, you would have to build it manually.

Unzip the file and move or copy its content into C:\Apache22

To start Apache open a command prompt (windows+r type "cmd" press "enter"). Navigate to *C:\Apache22\bin* and type httpd.exe then enter

@cocolote
cocolote / win-network-commands.md
Last active August 29, 2015 14:24
Some windows network commands

#Windos Network Commands

###nslookup The nslookup tool can help you to verify that DNS name resolution is working correctly. When you run nslookup against a host name, the tool will show you how the name was resolved, as well as which DNS server was used during the lookup. This tool can be extremely helpful when troubleshooting problems related to legacy DNS records that still exist but that are no longer correct. To use this tool, just enter the nslookup command, followed by the name of the host you want to resolve. For example:

nslookup tsdata.ts24

###netstat -an The netstat command is particularly useful, displaying all sorts of network statistics when used with its various options. One of the most interesting variants of netstat is netstat -an, which will display a list of all open network connections on their computer, along with the port they’re using and the foreign IP address they’re connected to.

@cocolote
cocolote / loop-CF.md
Last active August 29, 2015 14:24
wild loops

Loops

  • The old for loop

cfloop have step attribute that you can use it to: increment in a different pase or decrement using negative numbers step = "-1" this would decrement 1 by one