Skip to content

Instantly share code, notes, and snippets.

View rheajt's full-sized avatar
🏠
Working from home

jordan rhea rheajt

🏠
Working from home
View GitHub Profile
@mohamedattahri
mohamedattahri / getgo.sh
Last active April 6, 2023 18:20
Upgrade a Go installation to the latest version
#!/usr/bin/env bash
# getgo helps you install any version of go, or simply upgrade
# to the latest.
#
# Go versions will be installed under "/usr/local/go/{VERSION}",
# and "/usr/local/go/latest" will always point to the latest
# version installed.
#
# Upgrade to the latest:
@rheajt
rheajt / Code.gs
Last active November 24, 2016 07:44
/**
* Return, rewrite, regrade
*
* @param {number} The original grade
* @param {number} The re-graded assignment
* @param {number} The percentage of the regraded assignment to count
* @return The curved grade
* @customfunction
*/
function REGRADEDCURVE(original, newGrade, percentage) {
@ummahusla
ummahusla / vim-cheat-sheet.md
Created February 18, 2016 11:52
Vim Cheat Sheet

Modes

Vim has two modes insertion mode and command mode. The editor begins in command mode, where the cursor movement and text deletion and pasting occur. Insertion mode begins upon entering an insertion or change command. [ESC] returns the editor to command mode (where you can quit, for example by typing :q!). Most commands execute as soon as you type them except for "colon" commands which execute when you press the ruturn key.

Quitting

  • :x Exit, saving changes
  • :q Exit as long as there have been no changes
  • ZZ Exit and save changes if any have been made
  • :q! Exit and ignore any changes

Inserting Text

@rheajt
rheajt / angular-analytics.js
Created January 19, 2016 07:38
google analytics with angularjs
/* Comment out the last line of the analytics code that is given by Google.
* This code triggers on page views in angular
*/
app.run(['$rootScope', '$location', '$window', function($rootScope, $location, $window) {
$rootScope.$on('$routeChangeSuccess', function() {
$window.ga('send', 'pageview', {page: $location.url()});
});
}]);
@t-mart
t-mart / netrw quick reference.md
Last active November 10, 2024 02:21
A quick reference for Vim's built-in netrw file selector.
Map Action
<F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file
<del> Netrw will attempt to remove the file/directory
- Makes Netrw go up one directory
a Toggles between normal display, hiding (suppress display of files matching g:netrw_list_hide) showing (display only files which match g:netrw_list_hide)
c Make browsing directory the current directory
C Setting the editing window
d Make a directory
@fizerkhan
fizerkhan / dokku-node-mongo.md
Last active June 26, 2024 09:36
NodeJS and MongoDB app in Dokku with Digital Ocean

Steps:

  1. Create Digital Ocean Droplet with Dokku v0.3.16 on 14.04 image

  2. Login into the droplet and Update local settings.

    sh -c "echo 'LANG=en_US.UTF-8\nLC_ALL=en_US.UTF-8' > /etc/default/locale"
    reboot
@learncodeacademy
learncodeacademy / deployUser.md
Last active October 8, 2022 18:56
Adding a deploy user in Linux

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

@Hendrixer
Hendrixer / Gulpfile.js
Last active June 7, 2022 14:42
Gulpfile with Livereload, Nodemon, and other features
var gulp = require('gulp'),
concat = require('gulp-concat'),
plumber = require('gulp-plumber'),
server = require('tiny-lr')(),
refresh = require('gulp-livereload'),
mocha = require('gulp-mocha'),
stylus = require('gulp-stylus'),
notify = require('gulp-notify'),
nodemon = require('gulp-nodemon'),
jshint = require('gulp-jshint'),
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active October 29, 2024 21:43
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version