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 DISTINCT 'sp_helptext ' + b.name | |
FROM syscomments a WITH (NOLOCK) | |
JOIN sysobjects b WITH (NOLOCK) ON a.id=b.id | |
WHERE | |
a.text LIKE '%[some text]%' AND | |
b.xtype='p' |
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
# Remove a directory recursively | |
$ rm -rf [dir-name] | |
# Rename a directory | |
# mv [old-path] [new-path] | |
# Find a process using a specific port | |
$ lsof -t -i:[port-number] | |
$ netstat -tulpn | grep :[port-number] |
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
<Storyboard x:Key="FlickerAnimation"> | |
<DoubleAnimation Storyboard.TargetProperty="Opacity" AutoReverse="True" RepeatBehavior="Forever" Duration="0:0:0.5" From="0.0" To="1.0"/> | |
</Storyboard> | |
<!-- ... --> | |
<Style.Triggers> | |
<DataTrigger Binding="{Binding SomeProperty}" Value="SomeValue"> | |
<DataTrigger.EnterActions> | |
<BeginStoryboard Name="Flicker" Storyboard="{StaticResource FlickerAnimation}" /> |
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
/** | |
* using (Job.StartNew("JobName")) | |
* { | |
* // Execution | |
* } | |
*/ | |
class Job : System.IDisposable | |
{ | |
public static Job StartNew(string name) |
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
# Show hidden files in Finder | |
defaults write com.apple.finder AppleShowAllFiles -boolean true | |
# The reverse | |
defaults delete com.apple.finder AppleShowAllFiles |
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
result='forever list | grep app.js' | |
if ["$result"] | |
then | |
echo "Already running." | |
else | |
forever start app.js | |
echo "Started." | |
fi |
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
forever stop app.js |
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
var cluster = require('cluster') | |
, express = require('express') | |
, config = require('./config/config'); | |
if (cluster.isMaster) { | |
for (var i = 0; i < config.ports.length; i++) { | |
cluster.fork({ PORT: config.ports[i] }); | |
} | |
} else { | |
var app = express(); |
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
public static string PropertyName<T>(Expression<Func<T>> expression) | |
{ | |
if (expression == null) | |
throw new ArgumentNullException("expression"); | |
var body = expression.Body as MemberExpression; | |
if (body == null) | |
throw new ArgumentException("Invalid expression", "expression"); |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
namespace DynamicLinq | |
{ | |
public static class DynamicLinqOperations | |
{ | |
private static MethodInfo orderByTemplate = typeof(Enumerable) |
OlderNewer