- Don't write all your new code on the production machine!
- Use a VCS!
- Document your functions using DocBlocks!
- Document your API (at least LIST the endpoints)... I have to decipher the meaning from your code, and that isn't really clear
- Use a single identifier as the primary ID in the API for a resource (ie don't return a list of group ids for listing groups and then expect the group name as the identifying parameter for modifying a group)
- Use a consistent model for representing the same data model in different endpoints!
- Don't concatenate fields in the API results unless there is a good reason to (e.g first name and last name)
- Don't expose the underlying database logic. This is leaky abstraction, especially when you do it inconsistently!!
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
| # zsh | |
| EMOJI=(💩 🐦 🚀 🐞 🎨 🍕 🐭 👽 ☕️ 🔬 💀 🐷 🐼 🐶 🐸 🐧 🐳 🍔 🍣 🍻 🔮 💰 💎 💾 💜 🍪 🌞 🌍 🐌 🐓 🍄 ) | |
| function random_emoji { | |
| echo -n "$EMOJI[$RANDOM%$#EMOJI+1]" | |
| } | |
| PROMPT="$(random_emoji) " | |
| RPROMPT='%c' |
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
| - name: Install Packages Needed To Compile PHP 7 | |
| apt: pkg={{ item }} state=latest | |
| with_items: | |
| - git | |
| - autoconf | |
| - bison | |
| - libxml2-dev | |
| - libbz2-dev | |
| - libmcrypt-dev | |
| - libcurl4-openssl-dev |
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
| ibus restart && sleep 1 && ibus engine xkb:se::swe |
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
| var gulp = require('gulp'); | |
| var sourcemaps = require('gulp-sourcemaps'); | |
| var source = require('vinyl-source-stream'); | |
| var buffer = require('vinyl-buffer'); | |
| var browserify = require('browserify'); | |
| var watchify = require('watchify'); | |
| var babel = require('babelify'); | |
| function compile(watch) { | |
| var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
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
| /* | |
| $ npm install request | |
| $ node bench.js | |
| */ | |
| var request = require('request'); | |
| var url = 'http://www.google.com'; | |
| var total_requests = 100; | |
| var 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
| #!/bin/ash | |
| ssh git@ip expand > repos.txt | |
| myarr=$(awk '{print $NF}' repos.txt) | |
| counter=0 | |
| for i in $myarr | |
| do | |
| counter=$(($counter+1)) | |
| if [ "$counter" -eq 1 ] || [ "$counter" -eq 2 ] | |
| then |
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 React\Promise; | |
| class CoroutineTest extends \PHPUnit_Framework_TestCase | |
| { | |
| public function testResolvedValueEqualsFinalYield() | |
| { | |
| $gen = function () { | |
| $a = (yield 21); |
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 | |
| require 'vendor/autoload.php'; | |
| use GuzzleHttp\Stream\BufferStream; | |
| use GuzzleHttp\Stream\AsyncReadStream; | |
| use GuzzleHttp\Ring\Future; | |
| $loop = React\EventLoop\Factory::create(); | |
| $dnsResolverFactory = new React\Dns\Resolver\Factory(); | |
| $dnsResolver = $dnsResolverFactory->createCached('8.8.8.8', $loop); |
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 | |
| /** | |
| * zmq-API v@PACKAGE_VERSION@ Docs build by DocThor [2014-08-19] | |
| * @package zmq | |
| */ | |
| /** | |
| * @package zmq | |
| */ | |
| class ZMQ { |