Skip to content

Instantly share code, notes, and snippets.

View feload's full-sized avatar

Felipe feload

View GitHub Profile
@feload
feload / DockerCleanupScripts.md
Created March 29, 2019 17:16 — forked from johnpapa/DockerCleanupScripts.md
Docker Cleanup Scripts

Docker - How to cleanup (unused) resources

Cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@feload
feload / shrink
Created September 9, 2018 23:58 — forked from tjarrett/shrink
For minimizing disk size of Centos 7 virtualbox machines for use with vagrant
#!/bin/bash
# Source: http://vstone.eu/reducing-vagrant-box-size/
# Modified by: Jason Yang [jason.yang at mercatustechnologies.com]
function pause() {
read -p "$*"
}
cat - << EOWARNING
@feload
feload / browser_detect.js
Created July 6, 2018 13:05 — forked from 2107/browser_detect.js
JavaScript: Detect Browser
// browser detect
var BrowserDetect = {
init: function() {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function(data) {
for (var i = 0; i < data.length; i++) {
var dataString = data[i].string;
@feload
feload / github.md
Created January 31, 2018 22:41 — forked from ajmalafif/github.md
git - clone recursive depth for submodules repos

git clone --recursive --origin wp-boiler --depth 1 git@github.com:pricelessmisc/wp-boiler.git

@feload
feload / install_elasticsearch_osx.md
Created January 25, 2018 18:27 — forked from djonsson/install_elasticsearch_osx.md
OS X installation instructions for Elasticsearch + Kibana + Marvel

What is this?

Following this guide will set up a local Elasticsearch with Kibana and Marvel using Homebrew and Homebrew Cask

Prerequisites

If you already have Java installed on your system, skip steps Install Cask and Install Java

If you already have Java and Homebrew installed on your system, skip steps Prerequisites, start at Install Elasticsearch and Kibana after running $ brew update

Install Homebrew

  • $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@feload
feload / readdir_recurs_sync.js
Created November 23, 2017 20:41 — forked from dlabey/readdir_recurs_sync.js
NodeJS ReaddirSync Recursive
function readdirRecursSync(dir, filelist) {
filelist = filelist || [];
var files = fs.readdirSync(dir);
files.forEach(function (file) {
file = path.join(dir, file);
if (fs.statSync(file).isDirectory()) {
filelist = readdirRecursSync(file, filelist);
@feload
feload / headless.md
Created October 3, 2017 15:57 — forked from addyosmani/headless.md
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

@feload
feload / DataTableToList.cs
Created April 27, 2017 15:00
Convert DataTable to a generic list - extension method
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Web;
namespace helper
{
/// <summary>
@feload
feload / node-npm-in-docker.sh
Created April 21, 2017 16:03 — forked from artemgordinskiy/node-npm-in-docker.sh
Run Node/NPM in a Docker container
# For example, run "npm install"
docker run -v "$PWD":/usr/src/app -w /usr/src/app node:4 npm install
# This command creates a container (downloading one first if you don't have it locally), runs the command in a current directory and quits the container
# Great Success!
@feload
feload / Git push deployment in 7 easy steps.md
Created April 21, 2017 15:56 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook