Skip to content

Instantly share code, notes, and snippets.

@devarda
devarda / city_names.js
Created January 14, 2020 20:38 — forked from norcal82/city_names.js
javascript array of major us city names
// javascript, coffeescript, jquery...
var city_names = ["Aberdeen", "Abilene", "Akron", "Albany", "Albuquerque", "Alexandria", "Allentown", "Amarillo", "Anaheim", "Anchorage", "Ann Arbor", "Antioch", "Apple Valley", "Appleton", "Arlington", "Arvada", "Asheville", "Athens", "Atlanta", "Atlantic City", "Augusta", "Aurora", "Austin", "Bakersfield", "Baltimore", "Barnstable", "Baton Rouge", "Beaumont", "Bel Air", "Bellevue", "Berkeley", "Bethlehem", "Billings", "Birmingham", "Bloomington", "Boise", "Boise City", "Bonita Springs", "Boston", "Boulder", "Bradenton", "Bremerton", "Bridgeport", "Brighton", "Brownsville", "Bryan", "Buffalo", "Burbank", "Burlington", "Cambridge", "Canton", "Cape Coral", "Carrollton", "Cary", "Cathedral City", "Cedar Rapids", "Champaign", "Chandler", "Charleston", "Charlotte", "Chattanooga", "Chesapeake", "Chicago", "Chula Vista", "Cincinnati", "Clarke County", "Clarksville", "Clearwater", "Cleveland", "College Station", "Colorado Springs", "Columbia", "Columbus", "Concord", "Coral Spri
@devarda
devarda / gulpfile.js
Created January 11, 2020 21:27 — forked from prplmark/gulpfile.js
Gulpfile with Webpack and SCSS watch
// Essentials
var gulp = require('gulp');
var webpack = require('webpack'); // Include webpack to add definePlugin
var webpackStream = require('webpack-stream'); // Use webpack-stream to compile
// Sass Requires
var sass = require('gulp-sass'); // Include SASS
var autoprefix = require('gulp-autoprefixer'); // Autoprefixer (always)
var rename = require('gulp-rename'); // Gulp Rename
var sourcemaps = require('gulp-sourcemaps'); // Sourcemaps (for sass)

Git-flow

We use git-flow to have master and development branches, merging at ease when working on hotfixes, features or releases with auto-tagging. We set the tag prefix to v to be able to standardize release versions. In example v1.0.0.

  1. Installation https://github.com/nvie/gitflow/wiki/Installation
  2. Watch introduction if unfamiliar https://vimeo.com/16018419
  3. Setup on your local repo by going into this project's directory and typing git flow init. Press enter for every question except for tag-prefix: Type v and enter. This will automatically recognize master and develop branches and will set you on develop branch.

Git-flow tips

@devarda
devarda / get minimum of object value in array.js
Created December 27, 2019 14:00
Neat one liner to get the minimum of [ {x:1}, {x:2}, {x:3} ]. Minimum of Array of Objects, specific key.
let arr = [ {x:1}, {x:2}, {x:3} ];
let min = Math.min.apply(Math, arr.map(o => o.x));
console.log('Minimum is", min);
@devarda
devarda / webstoemp-gulpfile.js
Created December 27, 2019 00:47 — forked from jeromecoupe/webstoemp-gulpfile.js
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@devarda
devarda / get_history.sh
Created December 22, 2019 03:33 — forked from TravelingTechGuy/get_history.sh
Get your Chrome history as a CSV file
#!/bin/bash
# Locate the history file in your profile, and copy it to the same folder as this script.
# On Mac: ~/Library/Application\ Support/Google/Chrome/Default/History
# On Windows: C:\Users\YOUR USER NAME\AppData\Local\Google\Chrome\User Data\Default\History
sqlite3 History <<!
.headers on
.mode csv
.output out.csv
@devarda
devarda / vagrant-cheat-sheet.md
Created October 23, 2019 02:20 — 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)
@devarda
devarda / vagrant-cheat-sheet.md
Created October 23, 2019 02:20 — 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)
#!/bin/bash
PROJECT_NAME="laravel-voyager"
laravel new $PROJECT_NAME
cd $PROJECT_NAME
git init .
vim .gitignore
git add .
git commit -am "fresh install"
composer require tcg/voyager
git add .

Access file in / public

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On