This file contains hidden or 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> | |
people = queryNew( | |
"id, firstName, lastName, email, country, ip_address", | |
"integer, varchar, varchar, varchar, varchar, varchar", | |
[{ | |
"id": 1, | |
"firstName": "Christopher", | |
"lastName": "Burton", | |
"email": "[email protected]", | |
"country": "Poland", |
This file contains hidden or 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" displayname="SimplePGP" { | |
public SimplePGP function init(Required String config="PDS") { | |
variables.logger = application.logbox.getLogger(this); | |
switch(arguments.config) { | |
default: { | |
variables.publicKeyPath = expandPath('/path/to/key.pub'); |
This file contains hidden or 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
import time | |
import logging | |
try: | |
import serial | |
except ImportError: | |
print('Python serial library required, on Ubuntu/Debian: ' + | |
'apt-get install python-serial python3-serial') | |
raise |
This file contains hidden or 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
<!--- https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/package-summary.html ---> | |
<cfset oCSV = createobject( "java", "org.apache.commons.csv.CSVFormat" )> | |
<cfset oParserObj = createobject( "java", "org.apache.commons.csv.CSVParser" )> | |
<cfdump var="#oParserObj#" expand="false"> | |
<cfset oIOFile = createobject( "java", "java.io.File" ).init( expandpath( "./CLIENTIMPORT.csv" ) )> | |
<cfset oCharset = createobject( "java", "java.nio.charset.StandardCharsets" )> | |
<cfset oFormat = oCSV.EXCEL.withDelimiter( "|").withFirstRecordAsHeader().withQuote(javacast("char","")).withRecordSeparator("\r\n")> | |
<cfdump var="#oIOFile#" expand="false"> |
This file contains hidden or 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
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
import serial, time, struct, array | |
from datetime import datetime | |
ser = serial.Serial() | |
ser.port = "/dev/ttyUSB0" # Set this to your serial port | |
ser.baudrate = 9600 |
This file contains hidden or 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
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
import serial, time, struct | |
import httplib, urllib | |
ser = serial.Serial("/dev/ttyUSB0", baudrate=9600, stopbits=1, parity="N", timeout=2) | |
ser.flushInput() |
This file contains hidden or 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
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
import serial, time, struct | |
ser = serial.Serial() | |
ser.port = "/dev/cu.wchusbserial1410" # Set this to your serial port | |
ser.baudrate = 9600 | |
ser.open() |
This file contains hidden or 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
<!--- NOTE: This technique is not 100% accurate because some DNS servers don't allow MX queries or may be slow to respond, | |
but this will identify addresses that are potentially bad or suspicious. ---> | |
<cfscript> | |
function isEmailDomainValid(email){ | |
var local.email = arguments.email; | |
var local.DNSServer = '8.8.8.8'; /* Google DNS */ | |
var local.timeout = 2000; | |
var local.attempts = 1; | |
var local.valid = true; | |
var local.emailDomain = trim(listlast(local.email,'@')); |
This file contains hidden or 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
#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; |
This file contains hidden or 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
server { | |
listen 443 http2 ssl; | |
server_name analytics.example.com; | |
location /ga_proxy { | |
proxy_set_header X-real-ip $remote_addr; | |
rewrite ^/ga_proxy/(.*)$ /$1?$args&uip=$remote_addr; | |
proxy_pass http://www.google-analytics.com; | |
break; | |
} | |
location /analytics.js { |