Skip to content

Instantly share code, notes, and snippets.

View ivanionut's full-sized avatar
🎯
Focusing

Ivan Ionut ivanionut

🎯
Focusing
View GitHub Profile
@ivanionut
ivanionut / dup-backup.sh
Created November 19, 2016 18:15 — forked from Silvenga/dup-backup.sh
For daily systemwide encrypted backups of Ubuntu servers to remote host of Google Drive (free 15GB of storage).
#!/bin/bash
# Place in /usr/share/backup/
# and make executable
# chmod 0744 dup-backup.sh
# install:
# apt-get install duplicity python-gdata python-gobject-2 python-paramiko
## Remeber to change Google drive user name and Google drive folder
## And change Email
# Must run as root for system wide backups
@ivanionut
ivanionut / S3Wrapper.cfc
Created October 27, 2016 07:19 — forked from nathfy/S3Wrapper.cfc
Amazon Web Services (AWS) S3 Wrapper for ColdFusion
/**
* Amazon S3 REST Wrapper
* Version Date: 2015-09-03
*
* Copyright 2015 CF Webtools | cfwebtools.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@ivanionut
ivanionut / gist:fe016427a0c81aefcf100dd046071f1b
Created September 27, 2016 07:03
CFML: UDF to highlight keywords in a string (useful for search result pages)
<cfscript>
/*
I highlight words in a string that are found in a keyword list. Useful for search result pages.
@param str String to be searched
@param searchterm Comma delimited list of keywords
*/
string function highlightKeywords( required string str, required string searchterm ){
var j = "";
var matches = "";
var word = "";
@ivanionut
ivanionut / nginx.conf
Created August 21, 2016 12:49 — forked from bradleyboy/nginx.conf
nginx rewrite setup for Koken
# Enable gzip. Highly recommending for best peformance
gzip on;
gzip_comp_level 6;
gzip_types text/html text/css text/javascript application/json application/javascript application/x-javascript;
# By default, do not set expire headers
expires 0;
# Set expires header for console CSS and JS.
# These files are timestamped with each new release, so it is safe to cache them agressively.
@ivanionut
ivanionut / nginx.conf
Created August 21, 2016 12:49 — forked from pyrmont/nginx.conf
This configuration file is designed to run the CMS Koken. If you just want a simple config file, use this instead: https://gist.github.com/pyrmont/6342859
daemon off;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /usr/local/etc/nginx/mime.types; # Update if necessary

Looping is employed by programming languages to repeat a behavior defined by a section of code either while a condition is maintained true (conditional looping), or a certain number of times (iterative looping). As with other programming languages, ColdFusion allows you to perform both iterative and conditional looping.

ColdFusion uses the cfloop tag to enable looping in tag-based syntax. cfloop permits you to loop over a variable such as a structure or array, loop while a condition remains true, or loop for a given iteration. ColdFusion permits looping in cfscript using for loops and do while loops.

Tag-based Looping

@ivanionut
ivanionut / passwordCheck.cfc
Created July 7, 2016 15:56
A ColdFusion component for testing the strength of a password, which is necessary for enhancing the security of an application.
<!------------------------------------------------------------------------------
|| Component : passwordCheck.cfc
|| Author : Jason Luttrell
|| Description : Functionality to test for password strength.
|| Public Methods : init()
|| : initialize component
|| isPasswordValid()
|| : returns boolean indicating whether or not the
|| password meets the minimum requirements.
|| getErrors()
@ivanionut
ivanionut / gist:6c8b77ef02c7d7a82058d1745d6f6971
Created June 21, 2016 12:28 — forked from alinpopa/gist:1281448
elasticsearch analyzer example - Test Queries
# Index
---------------------------------------------------------------------
curl -XPUT http://localhost:9200/pictures/ -d '
{
"settings": {
"analysis": {
"analyzer": {
"index_analyzer": {
"tokenizer": "standard",
@ivanionut
ivanionut / nginx.conf
Created May 24, 2016 17:24 — forked from andyj/nginx.conf
Server portion for setting up a proxy to Lucee with rewrite to have index.cfm omitted for SES.
http {
...
server {
listen 80;
server_name example.com;
root /var/www/exmaple.com/www/;
index index.cfm;
set $lucee_context "example.com";
@ivanionut
ivanionut / linuxDateTime.cfc
Created May 9, 2016 09:31 — forked from randomweapon/linuxDateTime.cfc
create linux date time in coldfusion as well as convert epoch time back to a coldfusion date.
<cfcomponent>
<!---
Function Name : linuxDateTime()
Author : Ryan Spencer
Created : 26/09/2008
General Notes : Returns the date from a Epoch Time format of seconds
since UTC January 1, 1970, 00:00:00 (Epoch time).