Skip to content

Instantly share code, notes, and snippets.

View jasteele12's full-sized avatar

John Steele jasteele12

View GitHub Profile
@jasteele12
jasteele12 / git-keep-fork-updated.md
Created December 4, 2017 23:53
Keep Your Git Forked Repository Up to Date

Keep Your Git Forked Repository Up to Date

  • Add the remote from the original repository to your forked repository:

git remote add upstream git://github.com/original-dev/original-repo.git
git fetch upstream

  • Update your forked repository:

git pull upstream master

@jasteele12
jasteele12 / putty-export-import.md
Last active December 4, 2017 22:20
Export/Import Putty Setting

Export/Import Putty Settings

Navigate to the following key in the registry, select it, right click, select Export, give it a name, and save it.

HKEY_CURRENT_USER\Software\SimonTatham\PuTTY

To import, double-click on the saved .reg file and answer yes to merge it.

Recover From an Offline Source

Open the registry editor and do the following:

@jasteele12
jasteele12 / index.js
Created November 20, 2017 21:27 — forked from adamduren/index.js
FullCalendar Sticky First Column & Header
this.$el = $(this.element.nativeElement);
const scrollableBody = this.element.querySelector('.fc-content-skeleton');
const scrollableHeader = this.element.querySelector('.fc-head-container > .fc-row');
const scrollableBg = this.element.querySelector('.fc-bg');
scrollableBody.addEventListener('scroll', () => {
scrollableHeader.scrollTo(scrollableBody.scrollLeft, 0);
scrollableBg.scrollTo(scrollableBody.scrollLeft, 0);
});
@jasteele12
jasteele12 / sublime-swap-paste.md
Created November 20, 2017 21:10
Sublime Text 3 - Swap Paste for Paste and Indent

Sublime Text 3 - Swap Paste for Paste and Indent

Stop wasting time indenting copyed/moved code!

Add this in your Default (Windows).sublime-keymap - Prefere_n_ces | Key Bindings

{ "keys": ["ctrl+v"], "command": "paste_and_indent" },
{ "keys": ["ctrl+shift+v"], "command": "paste" }

Mac OSX users substitute super for ctrl since you probalby don't know how to use emacs anyway ;-P

@jasteele12
jasteele12 / cloud9-mysql-user.sh
Created November 19, 2017 14:57
Create a new MySQL user on Cloud9
# Create a new MySQL user on Cloud9 - Change both __username__ and __password__ below
mysql-ctl cli
-- by default, Cloud9 creates an empty database named 'c9'
-- create user
CREATE USER '__username__'@'127.0.0.1' IDENTIFIED BY '__password__';
-- privileges
GRANT ALL PRIVILEGES ON *.* TO '__username__'@'127.0.0.1' WITH GRANT OPTION;
FLUSH PRIVILEGES;
@jasteele12
jasteele12 / php-date-cheatsheet.md
Created November 19, 2017 14:55
PHP Date Cheatsheet

PHP Date Cheatsheet

Day Format Value/Example
d 01 through 31
D Mon through Sun
j 1 through 31
l (lowercase 'L') Sunday throguh Saturday
N 1 (Monday) to 7 (Sunday)
S st, nd, rd, th
w 0 (sunday) through 6 (Saturday)
@jasteele12
jasteele12 / cloud9-concrete5.md
Last active November 19, 2017 12:45
Cloud9 concrete5 application/config/concrete.php

Cloud9 concrete5 (and Load Balancers)

Create application/config/concrete.php or just add the 'security' array portion if the file already exists.

<?php /* application/config/concrete.php */

return array(
    // override for load balancers and Cloud9
  'security' => array(
    'trusted_proxies' => array(
 'ips' =&gt; array($_SERVER['REMOTE_ADDR']) // the remote IP address
@jasteele12
jasteele12 / cloud9-php7.md
Last active November 19, 2017 09:12
Upgrade Cloud9 to PHP 7

How to Upgrade a Cloud9 PHP Workspace to PHP 7.0

  # The main PHP repository (with many PECL extensions)
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -y

sudo apt-get install php7.0-curl php7.0-cli php7.0-dev php7.0-gd php7.0-intl \
  php7.0-mcrypt php7.0-json php7.0-mysql php7.0-opcache php7.0-bcmath php7.0-mbstring \
  php7.0-soap php7.0-xml php7.0-zip -y
@jasteele12
jasteele12 / cloud9-elgg.md
Created November 19, 2017 08:13
Install Elgg on Cloud9

Installing Elgg on Cloud9 IDE

1. Create a c9 workspace

Go to http://c9.io (Login with Github) On the Dashboard, click “Create new workspace” Choose a project name (e.g. “elgg”) Choose “PHP” for project type Click “Create” (Wait... ~1 min for c9 workspace to be ready) Click “Start editing” for the workspace

@jasteele12
jasteele12 / get-socat.sh
Last active November 19, 2017 07:38
Install socat on Cloud9 (or Ubuntu based systems)
#!/bin/sh
#
# get-socat.sh - Multipurpose Relay (SOcket CAT) - See: http://www.dest-unreach.org/socat/doc/socat.html
sudo apt-get update
sudo apt-get install socat
# Cloud9 only allows ports 8080-8082 ($PORT environment variable from your application)
#
# Here's how to forward say port 8888 to port 8081 - https://c58-jasteele.cusers.io:8888