This file contains hidden or 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
## transfer a whole dir from one server to another | |
## | |
scp -P 31415 -r /var/www/vhosts/roelvanderven.com/subdomains/dump/httpdocs/* [email protected]:/usr/local/www/dump/ |
This file contains hidden or 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
// | |
// I don't like logic in views / template files. | |
// Here's a first attempt of nicely identifying your pages by page titles. | |
// | |
// Yes, I know Wordpress' body_class() does something similar, | |
// but I like semantics and readable code. | |
// | |
// Put this in your functions.php: | |
// Print the sanitized page title as #id in the body tag: |
This file contains hidden or 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
mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone --depth 1 git://github.com/wayneeseguin/rvm.git && cd rvm && ./install |
This file contains hidden or 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
## | |
## My .profile file. | |
## Replace Roel with your own username! | |
## | |
export PS1='\u@\h:\w $(vcprompt)\$ ' | |
export PATH=/usr/local/sbin:$PATH | |
export CDPATH=/Users/Roel/Sites | |
## |
This file contains hidden or 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 `plaats`, count(*) AS `Number` | |
FROM `kijkmijnhuis` | |
GROUP BY `plaats` | |
ORDER BY `Number` DESC | |
LIMIT 20; |
This file contains hidden or 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
## | |
## Parse a whole directory of .eml files | |
## and retrieve all printed emailaddresses, sort them, and remove duplicates | |
## and print to a file. | |
## | |
perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}' *.* | sort -u > /tmp/output.txt |
This file contains hidden or 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
## | |
## Add awesome git functions to check differentiation between branches. | |
## Add this to your ~/.profile and reload with $ source ~/.profile | |
## | |
## See http://stackoverflow.com/questions/53569/how-to-get-the-changes-on-a-branch-in-git | |
## | |
function parse_git_branch { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
} |
This file contains hidden or 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 sendMail($subject, $body, $receiver) { | |
$sender = array('[email protected]' => 'Inzetkast.nl'); | |
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl') | |
->setUsername('[email protected]') | |
->setPassword('xxxx') | |
; | |
$mailer = Swift_Mailer::newInstance($transport); | |
$message = Swift_Message::newInstance($subject) |
This file contains hidden or 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
# Create extra ClientApplications on dev environment | |
# Run in script/console | |
# | |
# Thanks Johan! | |
ClientApplication.all.each { |app| AccessToken.create(:user_id => 303477976, :client_application_id => app.id, :authorized_at => Time.now) } |
This file contains hidden or 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
<?php | |
/* | |
- Check folder images for available images files (I used gif only in this case) | |
- Loop through all images and render them inline in HTML, using dataURI's with Base64 encoding through PHP | |
- View the output in your browser to get the encoded strings | |
*/ |