Skip to content

Instantly share code, notes, and snippets.

View roycehaynes's full-sized avatar

Royce Haynes roycehaynes

View GitHub Profile
@roycehaynes
roycehaynes / iterm2.md
Created November 20, 2018 20:34 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab ⌘ + T
Close Tab or Window ⌘ + W (same as many mac apps)
Go to Tab ⌘ + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction ⌘ + Option + Arrow Key
Cycle iTerm Windows ⌘ + backtick (true of all mac apps and works with desktops/mission control)

Keybase proof

I hereby claim:

  • I am roycehaynes on github.
  • I am roycehaynes (https://keybase.io/roycehaynes) on keybase.
  • I have a public key ASBUo58WjFC0dUjpon1xHbWVsrPO0f2Hg6rTqlmcGRWy9go

To claim this, I am signing this object:

#RewriteEngine On
# This will enable the Rewrite capabilities
#RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
#RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e. http://www.example.com/foo/ to https://www.example.com/foo/
# The leading slash is made optional so that this will work either in httpd.conf
@roycehaynes
roycehaynes / snowshow_pricing.html
Created May 15, 2013 17:41
Here's an example...
<html>
<head>
<title></title>
<script type="text/javascript">
function calculatePrice(){
var form = document.forms['computePrice'];
var numOfUnits = form.elements['numOfUnits'].value;
var leadTime = form.elements['leadTime'].value;
@roycehaynes
roycehaynes / Server.php
Created February 26, 2013 20:34
Magento 623 error code issue
/**
* Handle an xmlrpc call (actual work)
*
* @param Zend_XmlRpc_Request $request
* @return Zend_XmlRpc_Response
* @throws Zend_XmlRpcServer_Exception|Exception
* Zend_XmlRpcServer_Exceptions are thrown for internal errors; otherwise,
* any other exception may be thrown by the callback
*/
protected function _handle(Zend_XmlRpc_Request $request)
{ u'_shards': { u'failed': 0, u'successful': 5, u'total': 5},
u'facets': { u'payment_rate': { u'_type': u'terms',
u'missing': 2,
u'other': 0,
u'terms': [ { u'count': 3,
u'term': u'350'}],
u'total': 3},
u'practice_location': { u'_type': u'terms',
u'missing': 2,
u'other': 0,
curl -XGET 'http://localhost:9200/lawyer/profile/_mapping?pretty=true'
{
"profile" : {
"properties" : {
"profile" : {
"properties" : {
"summary" : {
"type" : "string"
},
"headline" : {
curl -XGET 'http://localhost:9200/lawyer/profile/_mapping?pretty=true'
{
"profile" : {
"properties" : {
"summary" : {
"type" : "string"
},
"headline" : {
"type" : "string"
},

To sort processes by memory usage:

ps aux --sort -rss

ps aux --sort -rss | head -10

To view files in a directory with tons of files (making ls slow):

ls -ltr * | tail

{
"name": "the-app",
"version": "0.1.0",
"description": "description",
"main": "gulpfile.js",
"author": "Royce Haynes",
"dependencies": {
"es6-promise": "^1.0.0",
"validator": "~3.17.1",