Skip to content

Instantly share code, notes, and snippets.

View angrycat's full-sized avatar

Andrew Ilin angrycat

  • 00:18 (UTC +02:00)
View GitHub Profile
# JavaScript
## VS Code JavaScript (ES6) snippets
### Import and export
| Trigger | Content |
| -------: | ------- |
| `imp→` | imports entire module `import fs from 'fs';`|
| `imn→` | imports entire module without module name `import 'animate.css'` |
| `imd→` | imports only a portion of the module using destructing `import {rename} from 'fs';` |

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

valet uninstall
sudo brew services stop nginx
sudo brew services stop php70
sudo brew services stop dnsmasq
brew uninstall nginx
brew uninstall php70
brew uninstall dnsmasq
rm -rf ~/.valet
rm /usr/local/bin/valet
@angrycat
angrycat / vagrant-cheat-sheet.md
Created April 11, 2018 21:33 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@angrycat
angrycat / index.html
Created September 7, 2015 09:22
Buttons
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
</head>
<body>
<div class="buttons">
<a href="#0" class="btn btn1">
@angrycat
angrycat / gist:3881825
Created October 12, 2012 22:02 — forked from SirPepe/gist:1073470
CSS Clearfix
/* Source: http://nicolasgallagher.com/micro-clearfix-hack/ */
/* For modern browsers */
.cf:before,
.cf:after {
content:"";
display:table;
}
.cf:after {
@angrycat
angrycat / PW2 tree.php
Created June 19, 2012 11:15
ProcessWire Build tree for navigation
<?php
define("n","\n");
define("br","<br />");
function buildTopMenu($pages, &$depth, $selector='', $maxDepth=2) {
global $active;
$out = '';
if($depth <= $maxDepth && $pages->getTotal() > 0) {
$depth++;
$out .= "<ul class='depth-{$depth}'>".n;
foreach($pages as $p) {