start new:
tmux
start new with session name:
tmux new -s myname
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
| <?php | |
| //returns a big old hunk of JSON from a non-private IG account page. | |
| function scrape_insta($username) { | |
| $insta_source = file_get_contents('http://instagram.com/'.$username); | |
| $shards = explode('window._sharedData = ', $insta_source); | |
| $insta_json = explode(';</script>', $shards[1]); | |
| $insta_array = json_decode($insta_json[0], TRUE); | |
| return $insta_array; | |
| } |
| <?php | |
| /** | |
| * start the customisation | |
| */ | |
| function custom_woo_before_shop_link() { | |
| add_filter('woocommerce_loop_add_to_cart_link', 'custom_woo_loop_add_to_cart_link', 10, 2); | |
| add_action('woocommerce_after_shop_loop', 'custom_woo_after_shop_loop'); | |
| } | |
| add_action('woocommerce_before_shop_loop', 'custom_woo_before_shop_link'); |
| var https = require('https'), | |
| user = process.argv[2], | |
| opts = parseOpts(process.argv.slice(3)) | |
| request('/users/' + user, function (res) { | |
| if (!res.public_repos) { | |
| console.log(res.message) | |
| return | |
| } | |
| var pages = Math.ceil(res.public_repos / 100), |
| <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
| <script> | |
| // http://mikemurko.com/general/jquery-keycode-cheatsheet/ | |
| var speed = 0.8; //transition speed | |
| var transition = "push"; //types of transition: instant, fade, swap, push | |
| var nextKeys= [39, 40, 34]; | |
| var prevKeys= [37, 38, 33]; | |
| $(function(){ |
NOTE (2022-07-09): Xcode finally added this functionality in Xcode 14, please see release notes here:
New Features in Xcode 14 Beta 3
When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491)
How to make an application icon for macOS using
iconset&iconutil
| sudo yum update | |
| sudo yum install -y docker | |
| sudo usermod -a -G docker ec2-user | |
| sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-`uname -s`-`uname -m` | sudo tee /usr/local/bin/docker-compose > /dev/null | |
| sudo chmod +x /usr/local/bin/docker-compose | |
| sudo service docker start | |
| sudo chkconfig docker on |