This file contains 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
#!/bin/bash | |
if [ ! -d "./backup" ]; then | |
mkdir backup | |
fi | |
lines=1024 | |
for i in *.csv; do | |
split -l ${1:-$lines} $i ${i%.csv}- | |
for j in ${i%.csv}-a*; do | |
if [[ "$j" != *-aa ]] |
This file contains 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/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains 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
<cfset id = form['_id']> | |
<cfset variables.fields = array(field("Queue name", "queuename", "#id#", true, "The queue to listen to", "text"), | |
field("Interval (seconds)","interval","60",true,"The interval between checks, in seconds","text") | |
) /> |
This file contains 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
<cfset id="???"><!--- a dummy value - never used ---> | |
<cfif structKeyExists(form,'_id')> | |
<cfset id = form['_id']> | |
</cfif> | |
<cfset variables.fields = array( | |
field("Queue name", "queuename", "#id#", true, "The queue to listen to", "text"), | |
field("Interval (seconds)","interval","60",true,"The interval between checks, in seconds","text") | |
) /> |
This file contains 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
; with cte | |
as (select *, ROW_NUMBER() over (PARTITION by invoiceNumber order by created desc) rn | |
from invoices | |
where accountId in (select accountId from accounts where carrierId=2)) | |
delete from cte where rn<>1 |
This file contains 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
ALTER TABLE myTable | |
add createdAt datetime | |
CONSTRAINT DF_myTable_createdat DEFAULT GETDATE() | |
ALTER TABLE myTable | |
add updatedAt datetime | |
CONSTRAINT DF_myTable_updatedAt DEFAULT GETDATE() | |
go |
This file contains 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
<cftry> | |
<cfset colList = "col1,col2,col3"> | |
<cfquery name="cols" datasource="#datasource#"> | |
SELECT column_name, data_type | |
FROM INFORMATION_SCHEMA.COLUMNS | |
where table_name = '#table_name#' |
This file contains 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
SELECT | |
'select ' + column_name + ' as txt, | |
''' + column_name + ''' as [column_name], | |
id from applications where ' + column_name + ' like ''%payday%'' union ' | |
FROM INFORMATION_SCHEMA.COLUMNS | |
where table_name = 'applications' | |
and data_type in ('nvarchar','varchar','char','nchar') |
This file contains 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
#!/bin/bash | |
FILES=Invoice_*_*.csv | |
for f in $FILES | |
do | |
newname=`echo $f| cut -d'_' -f 2` | |
newnamelen=${#newname} | |
leading=$[newnamelen-9] | |
invnum=${newname:leading} | |
mv $f $invnum.csv | |
done |
This file contains 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
doc.search("[text()*='b']").size |
OlderNewer