start new:
tmux
start new with session name:
tmux new -s myname
#Linux | |
echo dir1 dir2 dir3 | xargs -n 1 cp file1 | |
#Windows | |
for /d %F in (e:\*) do @if /i "%F" neq "e:\wav" 2>nul xcopy "%F\*.wav" "e:\wav" |
#Exec | |
$ irb | |
>> exec 'echo "hello $HOSTNAME"' | |
hello nate.local | |
$ | |
#System | |
$ irb | |
>> system 'echo "hello $HOSTNAME"' |
rdesktop -u username -g 1024×768 servername |
set nocompatible " Disable vi-compatibility | |
set t_Co=256 | |
colorscheme xoria256 | |
set guifont=menlo\ for\ powerline:h16 | |
set guioptions-=T " Removes top toolbar | |
set guioptions-=r " Removes right hand scroll bar | |
set go-=L " Removes left hand scroll bar | |
set linespace=15 |
Try running sudo apt-get update separately on a command line. Your Ubuntu might be old and its repositories could be out of date. So apt-get update itself is maybe not working in your machine. | |
To step over that issue, run the following commands: | |
# Disable RVM from trying to install necessary software via apt-get | |
rvm autolibs disable | |
# Then try installing Ruby: | |
rvm install 1.8.7 |
You can use: Request::url() to obtain the current URL, here is an example: | |
@if(Request::url() === 'your url here') | |
// code | |
@endif | |
Laravel offers a method to find out, whether the URL matches a pattern or not | |
if (Request::is('admin/*')) | |
{ | |
// code |
<script type="text/javascript"> | |
window.onbeforeunload = function() { | |
return "Dude, are you sure you want to leave? Think of the kittens!"; | |
} | |
</script> |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
<?php | |
$news_term = get_term_by('name', 'news', 'category'); | |
if(!empty($news_term)) { | |
$news_child_terms = get_categories(array( | |
'parent' => $news_term->term_id | |
)); |