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
(define (enumerate-interval low high) | |
(if (> low high) | |
'() | |
(cons low (enumerate-interval (+ low 1) high)))) | |
(define (accumulate op initial sequence) | |
(if (null? sequence) | |
initial | |
(op (car sequence) | |
(accumulate op initial (cdr sequence))))) |
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
;;http://programmingpraxis.com/2011/04/26/miscellanea/ | |
;FizzBuzz | |
(define (enumerate-interval low high) | |
(if (> low high) | |
'() | |
(cons low (enumerate-interval (+ low 1) high)))) | |
(define (fizz-buzz n) | |
(for-each (lambda (x) (display x) (newline)) |
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
--kill all connections for a database on ms sql server | |
SET NOCOUNT ON | |
DECLARE @DBName varchar(50) | |
DECLARE @spidstr varchar(8000) | |
DECLARE @ConnKilled smallint | |
SET @ConnKilled=0 | |
SET @spidstr = '' | |
Set @DBName = 'databasename' | |
IF db_id(@DBName) < 4 |
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
--get all tables size in a SQL Server database | |
EXEC sp_MSforeachtable @command1="EXEC sp_spaceused '?'" |
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
EXEC sp_MSforeachtable @command1="print '?'", @command2="ALTER INDEX ALL ON ? REBUILD WITH (ONLINE=OFF)" | |
GO | |
EXEC sp_updatestats | |
GO |
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
gci c:\yourdirectory -include .svn -Recurse -Force | Remove-Item -Recurse -Force |
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
;run in chez scheme 8.4 | |
;http://programmingpraxis.com/2013/01/15/translate-csv-to-html/ | |
;TODO: read csv file | |
; parse csv file to a list | |
(define (string-split sep str) | |
(define (f cs xs) (cons (list->string (reverse cs)) xs)) | |
(let loop ((ss (string->list str)) (cs '()) (xs '())) | |
(cond ((null? ss) (reverse (if (null? cs) xs (f cs xs)))) | |
((char=? (car ss) sep) (loop (cdr ss) '() (f cs xs))) | |
(else (loop (cdr ss) (cons (car ss) cs) xs))))) |
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
export PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 "(%s)") \n\[\033[01;34m\]$\[\033[00m\] ' |
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
git archive -o /c/deploy/latest.zip 76cd4788 $(git diff --name-only da43a85 76cd4788) |
OlderNewer