Skip to content

Instantly share code, notes, and snippets.

View gyuwon's full-sized avatar

Gyuwon Yi gyuwon

View GitHub Profile
result='forever list | grep app.js'
if ["$result"]
then
echo "Already running."
else
forever start app.js
echo "Started."
fi
# Show hidden files in Finder
defaults write com.apple.finder AppleShowAllFiles -boolean true
# The reverse
defaults delete com.apple.finder AppleShowAllFiles
@gyuwon
gyuwon / JobPerformance.cs
Created November 29, 2013 05:14
Simple .NET performance measurement helper class
/**
* using (Job.StartNew("JobName"))
* {
* // Execution
* }
*/
class Job : System.IDisposable
{
public static Job StartNew(string name)
<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}" />
@gyuwon
gyuwon / ubuntu-commands
Last active December 29, 2015 12:39
Ubuntu Commands
# 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]
@gyuwon
gyuwon / sp-text.sql
Last active December 28, 2015 18:39
Search stored procedures which have the specified text in MS SQL Server
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'