Skip to content

Instantly share code, notes, and snippets.

@pram
pram / docker_gui.sh
Last active September 11, 2020 01:42
Create Docker GUI Container
# From https://stackoverflow.com/questions/16296753/can-you-run-gui-applications-in-a-docker-container/25280523#25280523
docker build -t xeyes - << __EOF__
FROM debian
RUN apt-get update
RUN apt-get install -qqy x11-apps
ENV DISPLAY :0
CMD xeyes
__EOF__
XSOCK=/tmp/.X11-unix
@pram
pram / build.gradle
Last active March 14, 2019 18:53
Gradle build file to upload third-party artifacts to a maven repository
//Also check - https://dzone.com/articles/how-to-upload-a-list-of-jars-into-nexus-or-artifac
// using gradle 1.2
apply plugin: 'maven'
group 'org.example.extlib'
version = '1.0.0'
@pram
pram / counter.sol
Created January 15, 2018 18:48
Solidity snippet
pragma solidity ^0.4.0;
contract Counter {
int private count = 0;
function incrementCounter() public {
count += 1;
}
function decrementCounter() public {
count -= 1;
}
function getCount() public constant returns (int) {
@pram
pram / invalidate_cloudfront_cache.sh
Created May 21, 2017 17:28
Cloudfront cache invalidate
SETLOCAL
SET DISTRIBUTION_ID= :: Set your distribution id here, it looks like a random string A3JF7TKL2VRF7X
SET BUCKET_NAME= ::PUT YORU BUCKET NAME HERE
hugo -v
:: Copy over pages - not static js/img/css/downloads
::--profile lauf
aws s3 sync --acl "public-read" --sse "AES256" public/ s3://%BUCKET_NAME%/ --exclude 'img' --exclude 'js' --exclude 'downloads' --exclude 'css' --exclude 'post'
@pram
pram / .block
Created March 20, 2017 17:25
The Force with React + D3, Approach #2
license: mit
@pram
pram / .block
Created March 20, 2017 17:25
The Force with React + D3, Approach #1
license: mit
@pram
pram / .block
Created March 20, 2017 17:25
The Force with React + D3, Approach #3
license: mit
@pram
pram / .block
Created March 20, 2017 17:24
React + D3 Boilerplate
license: mit
@pram
pram / .block
Created March 17, 2017 17:05
zoomable, draggable force layout with labels
license: mit
border: yes
@pram
pram / .block
Created March 15, 2017 19:05
Network Annotation with Collision Detection
license: mit