Skip to content

Instantly share code, notes, and snippets.

View pongstr's full-sized avatar
:octocat:

pongstr pongstr

:octocat:
View GitHub Profile
@pongstr
pongstr / docker-cleanup-resources.md
Created July 5, 2017 03:34 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to 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

@pongstr
pongstr / app.js
Created February 20, 2017 00:42 — forked from katowulf/app.js
Simple paginate example in AngularFire with Firebase.util (http://firebase.github.io/firebase-util/)
var app = angular.module('app', ['firebase']);
app.controller('ctrl', function($scope, $pageArray) {
$scope.pageItems = $pageArray(ref, 'number');
});
app.factory('$pageArray', function($firebaseArray) {
return function(ref, field) {
// create a Paginate reference
var pageRef = new Firebase.util.Paginate(ref, field, {maxCacheSize: 250});
@pongstr
pongstr / LICENSE.txt
Created December 13, 2016 04:42 — forked from jed/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@pongstr
pongstr / .profile
Last active September 9, 2016 20:37 — forked from sindresorhus/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@pongstr
pongstr / README.md
Created December 11, 2015 10:11 — forked from balupton/README.md
Installing ChromiumOS

Install ChromiumOS

  1. Get Chromium OS from one of the following places
    1. Download the vanilla build (old but stable): http://chromeos.hexxeh.net/
      1. NOTE: Password is facepunch
    2. Download the nightly build (sync doesn't work): http://download-chromiumos.appspot.com/
      1. NOTE: If you want developer mode, you must change _base_ in the download URL to _test_ as the base image does not have developer tools enabled
      2. NOTE: Password is unknown, instructions for working around this are provided later
      3. NOTE: I could not get syncing working with this build, perhaps due to no API KEYS being provided???
  2. NOTE: I could not move past the welcome screen on the 64bit build due to no network being found (32bit worked)
web:
build: ./coder/
expose:
- "5000"
links:
- "db:redis"
- "mongodb"
command: nodemon -L app/server/server.js
nginx:
@pongstr
pongstr / tutorial_1.sh
Created September 23, 2015 06:41 — forked from fikriauliya/tutorial_1.sh
Docker
$ sudo docker run ubuntu:14.04 /bin/echo 'Hello world'
# The -t flag assigns a pseudo-tty or terminal inside our new container and the -i flag allows us to make an interactive connection by grabbing the standard in (STDIN) of the container.
$ sudo docker run -t -i ubuntu:14.04 /bin/bash
# A Daemonized Hello world
$ sudo docker run -d ubuntu:14.04 /bin/sh -c "while true; do echo hello world; sleep 1; done"
1e5535038e285177d5214659a068137486f96ee5c2e85a4ac52dc83f2ebe4147
$ sudo docker ps

Git Magic

How to fetch remote changes?

 > git fetch --all
 > git fetch --tags

How to move and push a tag?

#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) {
$scope.$on('authLoaded', function() {
$scope.isExpert($scope.main.serieId);
$scope.isMember($scope.main.serieId);
});
$scope.loadAuth = function() {
Auth.load().success(function(data) {
$scope.main.user = data.user;
$scope.$broadcast("authLoaded");