Skip to content

Instantly share code, notes, and snippets.

View gAmUssA's full-sized avatar
so hard

Viktor Gamov gAmUssA

so hard
View GitHub Profile
@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

@danveloper
danveloper / MainController.java
Created April 13, 2015 20:38
Spring Boot Hello World JSON No Annotations
package app;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.GenericBeanDefinition;
import org.springframework.boot.SpringApplication;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.http.server.ServletServerHttpResponse;
import org.springframework.web.servlet.ModelAndView;
@dpryden
dpryden / ClassLoaderLeakExample.java
Created October 20, 2014 00:01
Example of a ClassLoader leak in Java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,
@sebsto
sebsto / gist:19b99f1fa1f32cae5d00
Created August 8, 2014 15:53
Install Maven with Yum on Amazon Linux
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
@jaicab
jaicab / responsive-video.css
Last active July 29, 2023 02:52
Pure CSS solution for embed videos with an aspect ratio of 16:9
.video-container {
position: relative;
padding-bottom: 56.25%; /*16:9*/
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
@timyates
timyates / wheee.groovy
Created January 27, 2014 12:51
Spinner whilst parsing files in Groovy on the command line
@Grab( 'com.bloidonia:groovy-common-extensions:0.5.5' )
@Grab('com.xlson.groovycsv:groovycsv:1.0')
import static com.xlson.groovycsv.CsvParser.parseCsv
import groovy.transform.*
// A bufferedReader with some output
@InheritConstructors
class SpinnerReader extends BufferedReader {
private String output = '/-\\|'
private int offset = 0
angular.module('restangularDemoApp', [
'restangular',
'ngCookies'
])
.constant('apiKey', 'YOUR_Mongolab_API_KEY')
.config(function(RestangularProvider, apiKey) {
RestangularProvider.setBaseUrl('https://api.mongolab.com/api/1/databases/YOURDATABASE/collections');
RestangularProvider.setDefaultRequestParams({
apiKey: apiKey
})
@mojavelinux
mojavelinux / marked-asciidoc-content.adoc
Last active March 7, 2024 20:23
Advice on configuring Marked (OSX) to work with AsciiDoc content using AsciiDoc (or Asciidoctor) as a custom Markdown processor, including how to get AsciiDoc includes to work.

Using Marked with AsciiDoc content

Using Marked with AsciiDoc content

Marked is an OSX application to preview Markdown syntax in HTML. It’s possible to configure AsciiDoc as an custom Markdown processor to create the HTML for your AsciiDoc files.

@jimothyGator
jimothyGator / README.md
Last active April 25, 2024 18:00
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@philsturgeon
philsturgeon / All Posts
Last active April 16, 2021 13:44
Octopress iTunes Feed
---
layout: post
title: "Episode 3: ExpressionEngine StackExchange"
date: 2012-12-20 10:47
comments: true
filename: some-file-name-without-extension
length: 52409154
summary: ExpressionEngine Pro Anna Brown and Testing Hero Chris Hartjes join Ben Edmunds and Phil Sturgeon to discuss the recent rumblings in the ExpressionEngine community and the new EE StackExchange site. We talk about Inversion of Control (IoC), what it is, why its useful and how it's done.
---