uname -a # Display Linux System Information
uname -r # Display kernel release information
uptime # Show how long the system has been running + load
hostname # Show system host name
hostname -i # Display the IP address of the host
last reboot # Show system reboot history
date # Show the current date and time
🏴☠️
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
#!/usr/bin/env bash | |
find . -type f -name '*.php' -exec php -l {} \; |
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
#!/usr/bin/env bash | |
TYPE=${1:-minor} | |
npm run docs | |
# Commit documenation changes if they exist | |
# @see http://stackoverflow.com/a/5143914/599230 | |
if ! git diff-index --quiet HEAD --; then | |
echo "The documentation has changes..." |
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
/** | |
* Convert cson snippets into a Markdown document for reference | |
*/ | |
const cson = require('cson'); | |
const glob = require ('glob'); | |
const path = require('path'); | |
const fs = require('fs'); | |
const _ = require('lodash'); | |
function Snippet(title, code, prefix, fileName, lang) { |
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
<?php | |
if ( | |
env('APP_DEBUG') === true | |
&& !preg_match('/(prd|production|prod)/', env('APP_ENV')) | |
) { | |
$app->get('_/phpinfo', function () { | |
ob_start(); | |
phpinfo(); | |
$response = ob_get_contents(); |
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
#!/usr/bin/env bash | |
# Update the origin remote and prune it | |
updateOrigin() | |
{ | |
git fetch origin | |
git remote prune origin | |
} | |
# List branches that are merged into integration, but not master |
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
docker rm $(docker ps -a --before 97b0b463468f | awk '{if (NR!=1) {print $1}}') |
Note: this is from the sympy/sympy wiki
The sympy git server is at https://github.com/sympy/sympy . The main Sympy repository may be cloned with "git clone git://github.com/sympy/sympy.git".
The first and the most important thing is that you should understand that git is '''different'''. For example it uses staging area (so called index) for iteratively preparing commits. This and other great and unique features of git make it the preference of many developers, so go read its documentation - you would not regret!
- git project page http://git.or.cz/
- git faq explaining many things http://git.or.cz/gitwiki/GitFaq *: make sure you read mails referenced from the faq - they are really brilliant, e.g. this mail by Linus about git and renames: http://permalink.gmane.org/gmane.comp.version-control.git/217
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
# models/comment.rb | |
class Comment < ActiveRecord::Base | |
belongs_to :commentable, polymorphic: true | |
validates :name, presence: true | |
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
<?php | |
// Custom author URI structure even if the site | |
// is configured to use a custom structure, ie: /my-prefix/%postname%/ | |
add_filter('init', function () { | |
global $wp_rewrite; | |
$wp_rewrite->author_structure = '/' . $wp_rewrite->author_base. '/%author%'; | |
// Only uncomment the flush_rules() method call if things are not working. | |
// After the rules are flushed (refresh page), this can be commented out again. |