Sean Hunter freshcutdevelopment
- Melbourne Australia
- Sign in to view email
- sean-hunter.io
View SubstringSQL
REVERSE(SUBSTRING(REVERSE([FIELD_NAME]), 0, CHARINDEX('CHAR', REVERSE([FIELD_NAME])))) |
View SplitByLineCount
$i=0; Get-Content .\filePaths.txt -ReadCount 500 | %{$i++; $_ | Out-File out_$i.txt} |
View Zip and Upload
function ZipAndUpload([string]$ftpUrl, [string]$ftpUsername, [string]$ftpPassword, [string]$inputPath, [string]$filterExpression) { | |
$webclient = New-Object System.Net.WebClient | |
$webclient.Credentials = New-Object System.Net.NetworkCredential($ftpUsername,$ftpPassword) | |
$inputPath = Resolve-Path $inputPath | |
$file = [System.Io.File]::GetAttributes($inputPath) | |
$uniqueFormatPart = Get-Date -format yyyyMMddHHmmssfff | |
View GetFilePathRoot
Function GetFilePath(FullPath) | |
Dim filePath, pathArray | |
pathArray = Split(FullPath, "\") | |
pathArray(UBound(pathArray)) = "" | |
filePath = Join(pathArray, "\") |
View TipCalculator_v1.fs
open System | |
//take sale amount and tip % | |
//compute the tip amount | |
//print out both the tip and the total amount of the bill | |
let tipAmount saleAmount tipPercentage = tipPercentage/100.00 * saleAmount | |
let totalAmount saleAmount tipPercentage = (tipAmount saleAmount tipPercentage) + saleAmount |
View quoteprinter.fs
open System | |
type quote = {message :string; actor: string;} | |
[<EntryPoint>] | |
let main argv = | |
let quotes = [{message="shaken not stirred"; actor="sean connery"}; | |
{message="i'll be back";actor="terminator"}] |
View storyprinter.fs
open System | |
type story = {verb:string;noun:string;adjective:string;adverb:string} | |
let getResponse choice = | |
match choice with | |
| "yes" -> "That's hilarious. \n" | |
| "no" -> "That sucks. \n" | |
| _ -> "I don't even know how to respond to that. \n" |
View app.html
<!-- app/app.html --> | |
<template> | |
<h1>${status}</h1> | |
</template> |
View aurelia-gulpfile.js
var gulp = require('gulp'); | |
var browserSync = require('browser-sync'); | |
var nodemon = require('gulp-nodemon'); | |
gulp.task('browser-sync', ['nodemon'], function() { | |
browserSync.init(null, { | |
proxy: "http://localhost:5001", | |
files: ["app/**/*.*"], | |
browser: "google chrome", | |
port: 7001, |
View aurelia-express.js
'use strict'; | |
var express = require('express'); | |
var app = express(); | |
app.use(express.static('app')); | |
app.get('/', function(req, res) { | |
res.sendfile('./app/test.html'); | |
}); |
OlderNewer