Skip to content

Instantly share code, notes, and snippets.

View Mindgames's full-sized avatar
:octocat:

Mathias Åsberg Mindgames

:octocat:
View GitHub Profile
@jacurtis
jacurtis / _spacing-helpers.scss
Last active August 19, 2024 14:41
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
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

@giefko
giefko / FileTransferTCPClient
Last active October 23, 2022 22:40
Python File Transfer over TCP
import socket # Import socket module
s = socket.socket() # Create a socket object
host = "1somehing.11somehing." #Ip address that the TCPServer is there
port = 50000 # Reserve a port for your service every new transfer wants a new port or you must wait.
s.connect((host, port))
s.send("Hello server!")
with open('received_file', 'wb') as f:
@PurpleBooth
PurpleBooth / README-Template.md
Last active September 23, 2024 09:44
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@shaundomingo
shaundomingo / gist:43a32b72904d89f90d58
Last active October 28, 2018 18:28
CoreOS in anger - deploying a scalable wordpress cluster on CoreOS with fleet, docker and vulcand

CoreOS can seem daunting at first. This tutorial is built to encourage you in your journey and to demonstrate the power of this minimalistic operating system.

Exercise 1: Boot up a 3 machine coreos cluster

1a: Install prerequisite software

1b: Clone the coreos-vagrant repo

@webaware
webaware / add-to-cart.php
Last active October 22, 2023 05:55 — forked from mikejolley/functions.php
WooCommerce purchase page add-to-cart with quantity and AJAX, by customising the add-to-cart template in the WooCommerce loop. See blog post for details: http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/
<?php
/**
* Loop Add to Cart -- with quantity and AJAX
* requires associated JavaScript file qty-add-to-cart.js
*
* @link http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/
* @link https://gist.github.com/mikejolley/2793710/
*/
// add this file to folder "woocommerce/loop" inside theme
@ryanve
ryanve / a.current.js
Last active December 7, 2016 11:58
Add `.current` class to anchors that link to the current URL.
//gist.github.com/ryanve/6153436
(function(anchors, url, i, a) {
while ((a = anchors[i++]) && a.classList)
a.href === url && a.classList.add('current');
}(document.getElementsByTagName('a'), location.href, 0));