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 X = cumSumFunc(image) | |
[m,n] = size(image); | |
X = zeros(m,n); | |
X(1,:) = image(1,:); | |
for i=2:m | |
for j=1:n | |
X(i,j) = image(i,j) + X(i-1,j); | |
end | |
end | |
end |
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
func ip2int(ip net.IP) uint32 { | |
if len(ip) == 16 { | |
return binary.BigEndian.Uint32(ip[12:16]) | |
} | |
return binary.BigEndian.Uint32(ip) | |
} | |
func int2ip(nn uint32) net.IP { | |
ip := make(net.IP, 4) | |
binary.BigEndian.PutUint32(ip, nn) |
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
<filter name='network_filter_1' chain='ipv4' priority='-700'> | |
<uuid>64b80046-9a9d-40c2-8782-ed5878146262</uuid> | |
<rule action='drop' direction='out' priority='500'> | |
<mac match='no' srcmacaddr='52:54:00:01:ad:9d'/> | |
</rule> | |
<rule action='return' direction='out' priority='500'> | |
<ip srcipaddr='192.168.100.101'/> | |
</rule> |
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
#!/bin/bash | |
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.** | |
## **This updated version has more options and less hardcoded variables.** | |
# Take one argument from the commandline: VM name | |
if ! [ $# -eq 1 ]; then | |
echo "Usage: $0 <node-name>" | |
exit 1 | |
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
# alias hub (installed with brew to sugar up git) as git | |
alias git=hub | |
# sublime aliasing | |
alias sb=subl | |
# ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl | |
# other good aliases | |
alias sites='cd ~/Sites' | |
alias play="cd ~/Development/playground" |
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
{ | |
"scripts": { | |
"post-install-cmd": [ | |
"php artisan optimize", | |
"chmod -Rvc 777 app/storage", | |
"chmod -R 777 public", | |
"php artisan cache:clear", | |
"php artisan migrate" | |
], | |
"post-update-cmd": [ |
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
# -------------------------------------------------- | |
# Setting up a Laravel app on dokku in a Vagrant box | |
# -------------------------------------------------- | |
# First: cloning the dokku repo | |
$ git clone https://github.com/progrium/dokku | |
$ cd dokku | |
# Start, configure & provision a new vagrant box using the Vagrantfile from the repo | |
$ vagrant up |
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
Post::whereHas('tags', function ($query) use ($t) { | |
$query->where('tag_id','=', $t); | |
})->whereHas('languages', function ( $query ) use ( $l ){ | |
$query->where('language_id', '=',$l); | |
})->orWhere(function ($q) use ($search) { | |
$q->where('title', 'LIKE', '%' . $search . '%') | |
->orWhere('explanation','LIKE','%'.$search.'%') | |
->orWhere('usage','LIKE','%'.$search.'%') | |
->orWhere('codeexample','LIKE','%'.$search.'%') | |
->orderBy('id','desc'); |
NewerOlder