This is a quick guide on installing HTTPie for Mac OS X systems. This is also useful if you want the python package management utility pip. An installed copy of Homebrew is a prerequisite.
brew install httpieThis is a quick guide on installing HTTPie for Mac OS X systems. This is also useful if you want the python package management utility pip. An installed copy of Homebrew is a prerequisite.
brew install httpie| # Last updated May, 2024 for Apple silicon Macs | |
| # Install Homebrew if you don't already have it: https://brew.sh | |
| # install nano from homebrew | |
| brew install nano nanorc | |
| # update your nanorc file | |
| echo 'include "'"$(brew --cellar nano)"'/*/share/nano/*.nanorc"' >> ~/.nanorc | |
| # close and re-open your terminal and you'll have syntax highlighting |
| <?php | |
| $data = range(0, 1000000); | |
| echo sprintf('%02.2f', (memory_get_usage() / 1048576))." MB of memory used\n"; | |
| // output: 137.92 MB of memory used | |
| foreach ($data as $key => $val) { | |
| //echo "key: ".$key." value: ".$val."\n"; |
| #!/bin/bash | |
| # Generate a changelog between the v1 and v2 tags | |
| # See the "pretty formats" section of the git manual if you want to customize the output: https://www.kernel.org/pub/software/scm/git/docs/git-log.html | |
| git log --no-merges --format="%an: %s" v1..v2 | |
| <?php | |
| foreach (hash_algos() as $algo) { | |
| $start_time = microtime(TRUE); | |
| for ($index = 0; $index <= 500000; $index++) { | |
| $hash = hash($algo, $index); | |
| } |
| # Install IUS and EPEL yum repos | |
| wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/5/x86_64/epel-release-5-4.noarch.rpm | |
| wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/5/x86_64/ius-release-1.0-11.ius.centos5.noarch.rpm | |
| rpm -i ius-release-1.0-11.ius.centos5.noarch.rpm epel-release-5-4.noarch.rpm | |
| # make sure your system is up to date for good measure | |
| yum update | |
| # Install the required packages | |
| yum install libgearman-devel php53u-devel gcc |
| Saw this interesting PHP Challenge. | |
| Replace SOMETHING so that the output is Hello World. | |
| if (SOMETHING) { | |
| echo "Hello"; | |
| } else { | |
| echo "World"; | |
| } |
| wget http://dl.fedoraproject.org/pub/epel/6/SRPMS/gearmand-1.1.8-2.el6.src.rpm | |
| yum install rpm-build libuuid-devel boost-devel boost-thread sqlite-devel tokyocabinet-devel libevent-devel libmemcached-devel memcached gperf postgresql-devel gperftools-devel | |
| rpmbuild --rebuild ~/gearmand-1.1.8-2.el6.src.rpm | |
| rpm -Uhv ~/rpmbuild/RPMS/x86_64/*.rpm | |
| service gearmand start |
| // This script loops though the list of collection names in a MongoDB and runs the compact operation on them | |
| // Simply paste this into the Mongo shell | |
| use testDbName; | |
| db.getCollectionNames().forEach(function (collectionName) { | |
| print('Compacting: ' + collectionName); | |
| db.runCommand({ compact: collectionName }); | |
| }); |
| <?php | |
| # /app/start/global.php | |
| /* | |
| This results in several dated log files | |
| /app/storage/logs/log-apache2handler-2014-02-02.txt | |
| /app/storage/logs/log-apache2handler-2014-02-03.txt |