Skip to content

Instantly share code, notes, and snippets.

View freality's full-sized avatar

Ken Love freality

View GitHub Profile
#!/bin/bash
if [[ $DEBUG == "true" ]]; then
set -x
fi
# Check if FQDN is given
if [ -z "$1" ]; then
echo "Usage: $0 rancher.yourdomain.com"
exit 1
fi
@eduardocardoso
eduardocardoso / gist:82a629882ddb02ab3677
Last active April 3, 2023 08:23
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@ijy
ijy / cartesian-product.js
Last active April 23, 2022 15:54
Underscore.js implementation of Cartesian Product (without any mutable variable). @see: http://stackoverflow.com/questions/12303989/cartesian-product-of-multiple-arrays-in-javascript
function cartesianProductOf() {
return _.reduce(arguments, function(a, b) {
return _.flatten(_.map(a, function(x) {
return _.map(b, function(y) {
return x.concat([y]);
});
}), true);
}, [ [] ]);
};
anonymous
anonymous / index.html
Created December 7, 2012 20:59
A CodePen by Cameron Baney. Creamy UI Elements - Custom buttons, range slider, radio buttons, checkboxes and tooltips. Dribbble Rebound of Gil's original shot.
<p class="credits">Dribbble Rebound of <a target="_blank" href="http://dribbble.com/shots/480058-Creamy-Ui-Elements">Creamy Ui Elements</a> by <a target="_blank" href="http://dribbble.com/Gmann___">Gil</a></p>
<form>
<fieldset>
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
</fieldset>
<fieldset>
<input type="radio" name="radio">
<input type="radio" name="radio">
anonymous
anonymous / index.html
Created December 7, 2012 20:31
A CodePen by Simon Busborg. Bounce Effect - Simple bounce effect made with css3 keyframe animation // @simonbusborg on twitter
<div class="holder">
<h1> Bounce Effect </h1>
<div class="avatar">
<a href="https://twitter.com/simonbusborg" target="_blank">
<img src="http://cl.busb.org/L79J/dj.png" class="user"/>
</a>
</div>
<p>Border bounce effect on hover</p>
</div>
@leomelzer
leomelzer / howto.md
Created October 24, 2012 22:29
Installing ImageMagick & Ghostscript on Ubuntu
  1. You have Ghostscript installed, right? Otherwise sudo apt-get install ghostscript
  2. This is important and installs the headers (iapi.h etc) which are required but don't come with the default Ghostscript package: sudo apt-get install libgs-dev
  3. I also needed sudo apt-get install gs-esp
  4. For me the pre compiled version of ImageMagick never accepted Ghostscript, so let's remove it: sudo apt-get --purge remove imagemagick
  5. Get the source of ImageMagick, untar it, cd ImageMagick-xx
  6. ./configure --with-gslib=yes [and what else you need]
  7. Confirm in the output near the bottom gslib yes yes and not gslib yes no
  8. make
  9. make install
  10. Run convert -list configure | grep DELEGATES => DELEGATES bzlib djvu freetype gs jpeg jng jp2 lcms png tiff x11 xml zlib
@leostratus
leostratus / html-entities.md
Created September 21, 2012 18:37
HTML Entities/HTML Escape Characters

Because somehow I always end up trolling the interwebs looking for a reference for these.

Symbol Code Entity Name
@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@mitsuoka
mitsuoka / MIME.dart
Last active November 11, 2022 12:43
Dart WebSocket chat server and client samples
library MIME;
// get MIME type (returns null if there is no such extension)
String mimeType(String extension) => _mimeMaps[extension];
// default MIME type mappings
Map _mimeMaps = const {
'abs': 'audio/x-mpeg',
'ai': 'application/postscript',
'aif': 'audio/x-aiff',
@kevinSuttle
kevinSuttle / meta-tags.md
Last active July 10, 2024 09:39 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags