// jQuery
$(document).ready(function() {
// 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
| # Goto a directory you can write to: | |
| cd ~ | |
| #get composer: | |
| curl -s https://getcomposer.org/installer | php | |
| # move composer into a bin directory you control: | |
| sudo mv composer.phar /usr/local/bin/composer | |
| # double check composer works | |
| composer about |
This should help you get Sendmail installed with basic configuration on Ubuntu.
- If sendmail isn't installed, install it:
sudo apt-get install sendmail - Configure
/etc/hostsfile:nano /etc/hosts - Make sure the line looks like this:
127.0.0.1 localhost yourhostname - Run Sendmail's config and answer 'Y' to everything:
sudo sendmailconfig - Restart apache
sudo service apache2 restart
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
| alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
| alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
| alias nginx.restart='nginx.stop && nginx.start' | |
| alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist" | |
| alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist" | |
| alias php-fpm.restart='php-fpm.stop && php-fpm.start' | |
| alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" | |
| alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" | |
| alias mysql.restart='mysql.stop && mysql.start' | |
| alias nginx.logs.error='tail -250f /usr/local/etc/nginx/logs/error.log' |
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
| package main | |
| import ( | |
| "fmt" | |
| "image" | |
| "os" | |
| _ "image/jpeg" | |
| _ "image/png" | |
| ) |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link href="//code.jquery.com/qunit/qunit-git.css" rel="stylesheet" type="text/css" /> | |
| <script src="//cdn.jsdelivr.net/es5.shim/2.1.0/es5-shim.min.js"></script> | |
| <script src="//code.jquery.com/jquery.min.js"></script> | |
| <script src="//cdn.jsdelivr.net/curl.js/0.7.5/jquery/curl.js"></script> | |
| <script src="//code.jquery.com/qunit/qunit-git.js"></script> | |
| <script src="//www.broofa.com/Tools/JSLitmus/JSLitmus.js"></script> | |
For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');
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/sh | |
| # @author Rob Wu <[email protected]> (https://robwu.nl) | |
| version=$1 | |
| if [[ "${version}" != *"."* ]] ; then | |
| echo "Repeat the command with an exact version:" | |
| suffix="[0-9.]*" | |
| # Version not specified in $1 | |
| [ -z $version ] && suffix="[0-9][0-9.]+" | |
| curl -s http://www.oldapps.com/google_chrome.php | grep -oP "google_chrome.php\?old_chrome=[0-9]+\">[A-Za-z ]+\K${version}${suffix}( [A-Za-z()]+)?" -m 10 | |
| elif [ -e "${version}_chrome_installer.exe" ] ; 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
| type Post struct { | |
| // db tag lets you specify the column name if it differs from the struct field | |
| Id int64 `db:"post_id"` | |
| Created int64 | |
| Title string `form:"Title" binding:"required"` | |
| Body string `form:"Body"` | |
| UserId int64 `form:"UserId"` | |
| Url string | |
| } |
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 | |
| //Display Fields | |
| add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 ); | |
| //JS to add fields for new variations | |
| add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' ); | |
| //Save variation fields | |
| add_action( 'woocommerce_process_product_meta_variable', 'save_variable_fields', 10, 1 ); | |
| /** |