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
Dir.glob( | |
'**/*', File::FNM_DOTMATCH | |
).reject { |a| a =~ /\.{1,2}$/ }.each do |f| | |
puts f | |
end |
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
-- if the stored procedure does not exist then create a placeholder | |
if not exists ( | |
select * from sys.objects where object_id = OBJECT_ID(N' p_MyProc') | |
and type = N'P' | |
) then | |
create procedure p_MyProc as RAISERROR ('MyProc not defined', 16, 1); | |
grant execute on p_MyProc to SomeRole | |
end | |
-- update stored proc |
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
unsigned PlatformTimeMs () { | |
#if defined(_WINDOWS_) | |
return GetTickCount(); | |
#else | |
#error Your implementation here | |
// something like clock_gettime(CLOCK_MONOTONIC, ...) for Unix/Linux | |
#endif | |
} |
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
@echo off | |
::configure-firewall-example.bat | |
::by Patrick Wyatt 12/22/2011 | |
::MIT License - do with as you will; no warranty | |
SETLOCAL EnableExtensions | |
if "%1" == "" ( | |
echo Usage: | |
echo %0 display | |
echo %0 install |
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
require 'pathname' | |
require 'date' | |
class WalkDir | |
def initialize (opts = {}) | |
# Set default handlers | |
@file_pattern = opts[:file_pattern] || /^[^.]/ # no hidden files | |
@dir_pattern = opts[:dir_pattern] || /^[^.]/ # no hidden directories | |
@result = opts[:result] || lambda { |pathname, match| return pathname, match } |
NewerOlder