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
# Use the prune switch, for example if you want to exclude the misc | |
# directory just add a -path ./misc -prune -o to your find command: | |
find . -path ./misc -prune -o -name '*.txt' -print | |
# Here is an example with multiple directories: | |
find . -type d \( -path dir1 -o -path dir2 -o -path dir3 \) -prune -o -print | |
# Here we exclude dir1, dir2 and dir3, since in find expressions it is an action, | |
# that acts on the criteria -path dir1 -o -path dir2 -o -path dir3 | |
# (if dir1 or dir2 or dir3), ANDed with type -d. Further action is -o print, just print. |
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 | |
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d %1 /f | |
rundll32.exe user32.dll,UpdatePerUserSystemParameters |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot "C:\xampp\htdocs\site" | |
ServerName site.com | |
ServerAlias www.site.com | |
DirectoryIndex app.php index.php index.html | |
<Directory "C:\xampp\htdocs\site"> | |
Options Indexes FollowSymLinks | |
Order allow,deny | |
Allow from all |
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
git checkout -b experimental origin/experimental |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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
function addScript(url) { | |
var head, script; | |
head = document.querySelector('head'); | |
script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = url; head.appendChild(script); | |
}; | |
function addStylesheet(url) { | |
var head, link; |
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
(function (document) { | |
var Utility = function(){}; | |
utility.prototype.htmlDecode = function (html) { | |
var e = document.createElement('div'); | |
e.innerHTML = html; | |
return 0 < e.nodeChilds.length ? e.nodeChilds[0].nodeValue : null; | |
}; | |
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
#!/usr/bin/env bash | |
if [ $# -lt 3 ]; then | |
echo "Error, bad command call" | |
echo "Example:" | |
echo "command.sh dbname dbuser dbpass" | |
exit | |
fi | |
dbhost='localhost' |
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
REM Find process to kill | |
tasklist /FO TABLE /FI "status eq running" | |
REM Kill process by NAME | |
taskkill /IM notepad.exe | |
REM Kill process by PID | |
taskkill /PID 409 | |
REM Kill process and secondary process |
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
REM create rasphone.pbk on C:\Windows\System32\ras | |
REM For connect | |
rasdial "Connection Name" username [password|*] | |
REM For disconnect | |
rasdial "Connection Name" /DISCONNECT |