Skip to content

Instantly share code, notes, and snippets.

docker ps -a | awk '/Exited/ { print $1 }' | xargs docker rm
docker images | awk '/none/ { print $3 }' | xargs docker image rm
@mikebobadilla
mikebobadilla / delete_containers.sh
Created December 21, 2018 03:57
Delete all stopped containers
docker ps -a | awk 'FNR > 1 {print $1}' | xargs docker rm
@mikebobadilla
mikebobadilla / setup.sh
Last active October 12, 2018 16:02 — forked from bradp/setup.sh
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
@mikebobadilla
mikebobadilla / .vimrc
Last active July 26, 2019 17:28
My vimrc
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'mattn/emmet-vim'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'prettier/vim-prettier', {
\ 'do': 'yarn install',
\ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'yaml', 'html'] }
" Initialize plugin system
@mikebobadilla
mikebobadilla / dabblet.css
Last active September 28, 2016 16:33
Untitled
.dropbtn {
background-color: #4CAF50;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}/* The container <div> - needed to position the dropdown content */
.dropdown {
position: relative;
# This gist illustrates how to create and execute a payment with Paypal using their REST API.
# For additional informations, check the documentation: https://developer.paypal.com/docs/api/
# Note 1: I assume that you have already created a developer account for Paypal and an application.
# To test that your code is working, use the sandbox accounts.
# https://developer.paypal.com/webapps/developer/applications/accounts
# Note 2: we will not use the Paypal REST API SDK package for Node.js
# https://github.com/paypal/rest-api-sdk-nodejs
@mikebobadilla
mikebobadilla / Sizes.md
Created February 9, 2016 06:14 — forked from jperl/Sizes.md
Meteor App Icon and Launch Screen Size Guide

###Icons

Name Size
iphone_2x 120x120
iphone_3x 180x180
ipad 76x76
ipad_2x 152x152
android_ldpi 36x36
android_mdpi 48x48
@mikebobadilla
mikebobadilla / gist:0af3672e54cbddb1ad5a
Created January 10, 2016 04:29
Excel serial number conversion to date in javascript
function ExcelDateToJSDate(serial) {
var utc_days = Math.floor(serial - 25569);
var utc_value = utc_days * 86400;
var date_info = new Date(utc_value * 1000);
var fractional_day = serial - Math.floor(serial) + 0.0000001;
var total_seconds = Math.floor(86400 * fractional_day);
var seconds = total_seconds % 60;
@mikebobadilla
mikebobadilla / gist:6e8e56a07197acae9be1
Created January 9, 2016 19:18
Format Date Function
function formatDate(date) {
var hours = date.getHours();
var minutes = date.getMinutes();
var ampm = hours >= 12 ? 'pm' : 'am';
hours = hours % 12;
hours = hours ? hours : 12; // the hour '0' should be '12'
minutes = minutes < 10 ? '0'+minutes : minutes;
var strTime = hours + ':' + minutes + ' ' + ampm;
return date.getMonth()+1 + "/" + date.getDate() + "/" + date.getFullYear() + " " + strTime;
}
@mikebobadilla
mikebobadilla / pubsub.js
Last active August 29, 2015 14:26 — forked from learncodeacademy/pubsub.js
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {