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
String DecodeQuotedPrintable(String input, Encoding encoding = null) | |
{ | |
encoding = encoding ?? Encoding.UTF8; | |
var decoded = Regex.Replace(input, @"=([0-9a-fA-F]{2})|=\r\n", | |
m => m.Groups[1].Success | |
? Convert.ToChar(Convert.ToInt32(m.Groups[1].Value, 16)).ToString() | |
: ""); | |
var rawBytes = decoded.Select(Convert.ToByte).ToArray(); |
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
# load zgen | |
source "${HOME}/.zgen/zgen/zgen.zsh" | |
ZSHRC="${HOME}/.zshrc" | |
# if this file is newer than init file | |
if ! zgen saved || [ "${ZSHRC}" -nt "${ZGEN_INIT}" ] ; then | |
echo "Creating a zgen save" | |
zgen oh-my-zsh |
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
# source: http://www.jonmaddox.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/ | |
mkdir my_blog_tmp | |
cd my_blog_tmp | |
# --no-metadata, tells GIT to leave all the SVN details behind (not the commit log) | |
git-svn init http://code.yoursite.net/my_blog/trunk/ --no-metadata | |
# remap all the SVN users to GIT users when it sucks down the source and history | |
git config svn.authorsfile ~/Desktop/users.txt |
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
(functioin($) { | |
$.extend($.tree.datastores, { | |
"asmx": function() { | |
// borrow datastore from "json" | |
var asmxds = $.tree.datastores.json(); | |
// override "load" function: | |
// 1. serialize input data into string through JSON.stringify | |
// 2. add "contentType" attribute to $.ajax call | |
asmxds.load = function(data, tree, opts, callback) { |
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
// Key/value storage | |
if ('localStorage' in window) { ... } | |
if ('sessionStorage' in window) { ... } | |
// SQL API | |
if ('openDatabase' in window) { ... } | |
// Offline application cache | |
if ('applicationCache' in window) { ... } |
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 | |
[name] database_name, | |
database_id, | |
SUSER_SNAME(owner_sid) owner_name, | |
recovery_model_desc, | |
collation_name, | |
[compatibility_level], | |
create_date | |
FROM sys.databases |
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
DECLARE @dbName nvarchar(max), @sql nvarchar(max) | |
SELECT @dbName = N'__DBNAME__', @sql = N'' | |
SELECT @sql = @sql + N'KILL ' + CONVERT(nvarchar(max), spid) + ';' | |
FROM master..sysprocesses | |
WHERE dbid = DB_ID(@dbName) | |
--EXEC sp_executesql @sql |
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
-- change dbowner of __DBNAME__ to sa | |
ALTER AUTHORIZATION ON DATABASE::[__DBNAME__] TO sa |
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
$PHANTOMJS_NATIVE_ARGS = | |
'cookies-file', | |
'config', | |
'disk-cache', | |
'ignore-ssl-errors', | |
'load-images', | |
'load-plugins', | |
'local-to-remote-url-access', | |
'max-disk-cache-size', | |
'output-encoding', |
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
@size: 150px; | |
@ribbon-width: 210px; | |
@ribbon-height: 28px; | |
@offset: 13px; | |
@ribbon-left: (@size - @ribbon-width) / 2 + @offset; | |
@ribbon-top: (@size - @ribbon-height) / 2 - @offset; | |
.ribbon { | |
width: @size; | |
height: @size; |
OlderNewer