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
| Bash oneliner | |
| for file in $(git ls-files --other --exclude-standard); do rm "$file"; done | |
| Git Clean, does the exact same thing | |
| git clean -df |
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
| # Remote Server | |
| useradd www-deploy -c "Deployment User" -d /home/www-deploy -G www-data -m -s /bin/bash | |
| sudo su - www-deploy | |
| # Localhost | |
| ssh-keygen -t rsa | |
| # Append your key to the Remote host authorized keys file | |
| cat id_rsa.pub >> ~/.ssh/authorized_keys |
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 | |
| namespace Acme\BlogBundle\Tests\Controller; | |
| use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
| class DefaultControllerTest extends WebTestCase | |
| { | |
| public function testIndex() | |
| { |
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 | |
| namespace Acme\BlogBundle\Controller; | |
| use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
| class AttachmentController extends Controller | |
| { | |
| public function redirectAction() |
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
| # bitcoin.conf configuration file. Lines beginning with # are comments. | |
| # Network-related settings: | |
| # Run on the test network instead of the real bitcoin network. | |
| #testnet=0 | |
| # Connect via a socks4 proxy | |
| #proxy=127.0.0.1:9050 | |
| ############################################################## |
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 | |
| /** | |
| * Computes the factorial of $n | |
| * @param interger $n Number you want to find the factorial for | |
| * @return string | |
| */ | |
| $factorial = function($n) { | |
| for($k=1, $i=1;$i <= $n;$i++) { | |
| $k = $k * $i; |
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 | |
| /** | |
| * This function will take an array and select n from it | |
| * without replacement. This can be used as a random number | |
| * generator | |
| * | |
| * Example: I want to select $n numbers from a pool of $N numbers | |
| * <code> | |
| * $values = $srs(range(1,100), 5); | |
| * </code> |
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 | |
| // get the sha512 hash of the txid and split it by 2 | |
| $pool = str_split(hash_hmac('sha512', $txid, $DailySecretKey), 2); | |
| // Loop and get 20 | |
| for($N=array(),$i = 0; count($N) < 20 && $i < count($pool); $i++) { | |
| // base 10 that shit | |
| $n = hexdec($pool[$i]); | |
| // make sure it meets the standards | |
| if ($n > 80 || $n < 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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "precise64" | |
| config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
| config.vm.network :forwarded_port, guest: 80, host: 8080 | |
| config.vm.network :private_network, ip: "192.168.33.10" | |
| config.vm.synced_folder ".", "/var/www/app.local", :nfs => true | |
| config.vm.provider :virtualbox do |vb| |