Skip to content

Instantly share code, notes, and snippets.

@apzentral
apzentral / store.js
Last active August 29, 2015 14:15
ReactJS: Skeleton for Store
/**
* Your Store
*/
'use strict';
/**
* Libraries
*/
var AppDispatcher = require('../dispatcher/AppDispatcher');
var EventEmitter = require('events').EventEmitter;
@apzentral
apzentral / component.js
Last active January 1, 2018 14:55
ReactJS: Skeleton for React component
/**
* @jsx React.DOM
*/
'use strict';
/**
* Libraries
*/
var React = require('react');
@apzentral
apzentral / component-es6.js
Last active January 16, 2018 23:46
ReactJS: Skeleton for React component in ES6
import React, { Component } from "react";
// Component
class ComponentClass extends Component {
constructor(props) {
super(props);
this.state = {};
}
@apzentral
apzentral / bash-remove-old-kernels.sh
Created July 11, 2018 15:54
Bash one-liner to delete only old kernels
dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r | cut -d- -f-2) | xargs sudo apt-get -y purge
@apzentral
apzentral / sublime.sublime-project
Created January 30, 2021 23:00
Sublime Project Setting
{
"folders": [
{
"path": ".",
"folder_exclude_patterns": [
"x64",
"x86",
".nuget",
"packages",
"TestResults",
@apzentral
apzentral / php.json
Created March 2, 2021 20:16
VS Code: PHP Code Snippets
{
// Place your snippets for php here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@apzentral
apzentral / dk-remove-all.sh
Created March 17, 2021 04:52
Remove all docker containers
#!/usr/bin/env bash
echo "Stoppping and removing all container(s)"
docker container stop $(docker container ls -aq) && docker container rm $(docker container ls -aq)
@apzentral
apzentral / dk-stop-all.sh
Created March 17, 2021 04:53
Stop all docker containers
#!/usr/bin/env bash
echo "Stoppping all container(s)"
docker container stop $(docker container ls -aq)
@apzentral
apzentral / docker-compose.yml
Last active April 1, 2021 00:34
Example: docker-compose.yml file
version: "3.8"
services:
demo-service:
build:
context: .
dockerfile: Dockerfile
restart: "no"
image: demo-image:2.4
@apzentral
apzentral / dk-network-all.sh
Created April 26, 2021 22:56
Docker check all subnet
# Need to install jq
docker network inspect $(docker network ls | awk '$3 == "bridge" { print $1}') | jq -r '.[] | .Name + " " + .IPAM.Config[0].Subnet' -