Skip to content

Instantly share code, notes, and snippets.

View rgsingh's full-sized avatar

Rai Singh rgsingh

View GitHub Profile
@protosam
protosam / Minikube for Mac Users.md
Last active March 8, 2022 22:50
Notes for switching from Docker Desktop to Minikube

With Docker Desktop becoming more restricted, I've decided to move on to just using minikube. In doing so, I've consolidated my notes as follows.

Installation

Use brew to install the docker cli and minikube.

$ brew install minikube docker kubectl hyperkit

Running Minikube

The first time you start minikube, you should specify any settings you desire.

@borischerkasky
borischerkasky / docker-compose.yml
Last active December 9, 2021 00:59
localstack docker compose
version: "3"
services:
localstack:
image: localstack/localstack
ports:
- "4568-4576:4568-4576"
- "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
environment:
- DOCKER_HOST=unix:///var/run/docker.sock
@jreijn
jreijn / EntityResource.java
Created May 9, 2018 22:37
IntelliJ Live template for Spring REST TDD demo
package ${PACKAGE_NAME};
import org.springframework.hateoas.Link;
import org.springframework.hateoas.Resource;
public class ${NAME} extends Resource<${ENTITY}> {
public ${NAME}(${ENTITY} content, Link... links) {
super(content, links);
}
<p>
My programming language of preference is python for the simple reason that I feel I write better code faster with it then I do with other languages. However also has a lot of nice tricks and idioms to do things well. And partly as a reminder to myself to use them, and partly because I thought this might be of general interest I have put together this collection of some of my favourite idioms. I am also putting this on <a href="https://gist.github.com/codefisher/9d7993ddbf404c505128">gist.github.com</a> so that anyone that wants to contribute there own things can, and I will try and keep this post up to date.
</p>
<h2>enumerate</h2>
<p>
A fairly common thing to do is loop over a list while also keeping track of what index we are up to. Now we could use a <code>count</code> variable, but python gives us a nicer syntax for this with the <code>enumerate()</code> function.
<script src="https://gist.github.com/codefisher/9d7993ddbf404c505128.js?file=enumerate.py"></script>
@casaval
casaval / gist:61b9808c90716ed6407f
Created June 24, 2014 04:58
Install love2d 0.9.1 on crunchbang debian wheezy
#step 1: install SDL
hg clone http://hg.libsdl.org/SDL
cd SDL
../configure
make [-j 4]
sudo make install
@rabidgremlin
rabidgremlin / Logstash Demo
Last active July 26, 2018 18:23
LogStash Demo
Files and commands for Logstash demo
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@omnisis
omnisis / H2EmbeddedTest.java
Last active February 29, 2020 14:16
Configuring H2 database for unit tests w/ spring
package examples.database;
import com.google.common.collect.Lists;
import examples.database.dao.PeopleDAO;
import examples.database.model.PeopleInfo;
import org.apache.commons.lang.time.StopWatch;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
@criminy
criminy / PageI.java
Created October 5, 2011 01:01
Initial MyBatis support for Spring-Data (specifically a sample repository and Pagination).
import java.util.Collection;
import java.util.List;
import java.util.ListIterator;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
/**
* Extension class between spring data commons and java.util.List that is
* required to get MyBatis to use it as a return value.
@lance
lance / gist:967267
Created May 11, 2011 20:28
Go The Fuck To Sleep
The cats nestle close to their kittens now.
The lambs have laid down with the sheep.
You’re cozy and warm in your bed, my dear.
Please go the fuck to sleep.
The windows are dark in the town, child.
The whales huddle down in the deep.
I’ll read you one very last book if you swear
You’ll go the fuck to sleep.