Skip to content

Instantly share code, notes, and snippets.

View jcanfield's full-sized avatar
💭
If I do not respond quickly, try me on Twitter at @creativeboulder.

Joshua Canfield jcanfield

💭
If I do not respond quickly, try me on Twitter at @creativeboulder.
View GitHub Profile
@jcanfield
jcanfield / crawl_site
Created January 9, 2017 21:39 — forked from reidransom/crawl_site
Download an entire website with wget
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/

Unix Command Line Notes

  • Command settings
    • .bashrc
      • Aliases - place the following on a new line in the .bashrc file
        • alias [alias-name]='[alias command(s)]
        • Ex:alias ls='ls -lh'
    • .profile or .bash_profile
  • Add folders to you path
@jcanfield
jcanfield / node-and-npm-in-30-seconds.sh
Created October 27, 2016 03:05 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@jcanfield
jcanfield / .bash_aliases
Created October 27, 2016 02:00 — forked from SimpleHomelab/.bash_aliases
bash_aliases for Ubuntu HTPC and Home Servers
# UPDATE AND UPGRADE
alias update='sudo apt-get update'
alias upgrade='sudo apt-get upgrade'
# PACKAGE MANAGEMENT
alias install='sudo apt-get install'
alias uninstall='sudo apt-get remove'
alias aptsearch='sudo apt-cache search'
alias addkey='sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com'
alias finstall='sudo apt-get -f install'
@jcanfield
jcanfield / devenv.sh
Created October 27, 2016 01:59
A small bashscript to setup an web-development environment with gulp, bower, nodejs in Ubuntu/Ubuntu-based distributions. !!! Be careful: I recommend to only use it on a fresh installed system, otherwise it could mess up something !!!
#!/bin/bash
# Echo to nowhere for a more beautiful console output
sudo echo > /dev/null
# Add nodejs and sublime text ppa
echo ':: adding ppas'
sudo add-apt-repository -y ppa:chris-lea/node.js > /dev/null 2>&1
sudo add-apt-repository -y ppa:webupd8team/sublime-text-3 > /dev/null 2>&1
@jcanfield
jcanfield / Ubuntu Fresh Install Script
Created October 27, 2016 01:58 — forked from mmstick/Ubuntu Fresh Install Script
After installing Ubuntu, simply run this script to configure a fresh installation.
#!/bin/bash
# Ubuntu 13.10 and 14.04 should work perfectly with this script.
# PPAS
## Essentials
sudo add-apt-repository -y "deb http://archive.canonical.com $(lsb_release -sc) partner"
sudo add-apt-repository -y ppa:mc3man/mpv-tests # MPV (ffmpeg version)
sudo add-apt-repository -y ppa:atareao/nautilus-extensions # Nautilus Image Extensions
sudo add-apt-repository -y ppa:ubuntu-wine/ppa # Updated Wine Packages from Wine Developers
sudo add-apt-repository -y ppa:webupd8team/y-ppa-manager # Namely for YAD
@jcanfield
jcanfield / .htaccess
Created August 17, 2016 09:07 — forked from jasperf/.htaccess
.htaccess boilerplate including expire headers, mod pagespeed, cache control headers, Gzip, Deflate #htaccess #seo
# BEGIN Expire headers
AddDefaultCharset UTF-8
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
@jcanfield
jcanfield / index.html
Created August 17, 2016 07:44 — forked from arkaitzgarro/index.html
HTML5 Boilerplate
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Plantilla HTML5</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/normalize.css">
@jcanfield
jcanfield / html5-boilerplate-4.3.0.slim
Created August 17, 2016 07:44 — forked from SteveBenner/html5-boilerplate-4.3.0.slim
Slim template - HTML5 Boilerplate index page
/ This template produces an EXACT replica of the `index.html` file found in HTML5 Boilerplate v4.3.0
/ The official distribution is located at: https://github.com/h5bp/html5-boilerplate/blob/v4.3.0/index.html
/
/ For a more elegant way to generate the HTML tags within IE conditional comments, see the abstraction
/ in my gist at: https://gist.github.com/SteveBenner/a71f41e175f135b7d69b
/
doctype html
/ The min and max values of the version range actually represent all values below or above the limit
- ie_versions = 6..9 # A minimum value of 6 for example, translates into 'less than 7'
- for version in ie_versions
@jcanfield
jcanfield / 0_reuse_code.js
Created March 4, 2016 22:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console