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 "fileutils" | |
# | |
files = ["foo/bar/blah.rb","foo/bar/stuff.rb","foo/bar/example/thing.rb","foo/ham/example"] | |
#create the directory structure based above array in current directory | |
FileUtils.makedirs( files.map{ |f| f }.uniq.reject{ |d| | |
File::exist?(d) } ) |
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
$ PATH=$(echo $PATH | sed -e 's;:\?/home/user/bin;;' -e 's;/home/user/bin:\?;;') |
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 'rubygems' | |
require 'grit' | |
include Grit | |
#directory /home/rubytest/grit/grit contains .git file | |
#directory path should contain .git else it give invalidGitRepository error | |
repo = Repo.new("/home/rubytest/grit/grit") | |
#print git commits | |
print repo.commits | |
head = repo.commits.first |
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
> GuidGen | |
REM to register assembly | |
> regasm test.dll |
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
%windir%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /unregister Test.exe /codebase | |
%windir%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe Test.exe /tlb:Test.tlb /codebase | |
pause |
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
private static string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location.ToString(); | |
if (!string.IsNullOrEmpty(servicePath)) | |
{ | |
Configuration config = ConfigurationManager.OpenExeConfiguration(exePath); | |
//here fetching the data from AppSettings with key name "UserName" | |
string userName = config.AppSettings.Settings["UserName"].Value.ToString(); | |
} |
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 owner,sum(bytes)/1024/1024 mb from dba_segments | |
group by owner; |
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 df.tablespace_name tsname,df.autoextensible, | |
sum(df.bytes)/1024/1024 tbs_size_mb | |
, nvl(sum(e.used_bytes)/1024/1024,0) used, nvl(sum(f.free_bytes)/1024/1024,0) avail | |
, rpad(' '||rpad('X',round(sum(e.used_bytes)*10/sum(df.bytes),0), 'X'),11,'-') used_visual, nvl((sum(e.used_bytes)*100)/sum(df.bytes),0) pct_used | |
FROM sys.dba_data_files df | |
, (SELECT file_id, sum(nvl(bytes,0)) used_bytes | |
FROM sys.dba_extents | |
GROUP BY file_id) e | |
, (SELECT max(bytes) free_bytes, file_id | |
FROM dba_free_space |
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
--http://stackoverflow.com/questions/155246/how-do-you-truncate-all-tables-in-a-database-using-tsql | |
--When dealing with deleting data from tables which have foreign key relationships - which is basically the -----case with any properly designed database - we can disable all the constraints, delete all the data and then ---re-enable constraints | |
-- disable all constraints | |
EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all" | |
-- delete data in all tables | |
EXEC sp_MSForEachTable "DELETE FROM ?" |
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
//Example of delegate | |
//Example in EventHandler (delegate) | |
using System; | |
using System.Configuration; | |
using System.Data; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Security; |
OlderNewer