Skip to content

Instantly share code, notes, and snippets.

chrome.tabs.onUpdated.addListener(function tabulator(tab){
const your_tab_Id = tab;
console.log(tab);
chrome.tabs.update(your_tab_Id, {active: true});
console.log(your_tab_Id);
// Execute code on the existing tab to open the Message.
chrome.scripting.executeScript({
target: { tabId: your_tab_Id, allFrames: true },
files: ['fakemask.js']
@shivergard
shivergard / docker-compose.yaml
Last active January 3, 2018 22:31
Hidden SSH
# docker version 2 example
version: "2"
services:
tor:
image: goldy/tor-hidden-service
links:
- ssh
environment:
@shivergard
shivergard / docker-compose.yaml
Created December 28, 2017 10:14
IOINIC Docker Compose
FROM node
MAINTAINER Ronalds Sovas <[email protected]>
RUN npm install -g cordova ionic && \
apt-get update && \
apt-get install -y unzip x11-apps ant && \
wget https://dl.google.com/dl/android/studio/ide-zips/3.0.1.0/android-studio-ide-171.4443003-linux.zip &&\
unzip android-studio-ide-171.4443003-linux.zip && \
cd /android-studio && \
version: '2'
services:
node:
build: ./
volumes:
- ./:/opt
- ./storage:/root
command: tail -f /dev/null
@shivergard
shivergard / api.md
Last active February 26, 2018 21:45
API for Mobile Web apps

#exFoodyCheck API Documentation (for demo access and stuff please write some comment ;) )

Get Barcode Info

Returns json data about a single product.

  • URL

    /api/v1/get_barcode_info

@shivergard
shivergard / docker-cleanup-resources.md
Created November 22, 2017 19:07 — forked from bastman/docker-cleanup-resources.md
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

@shivergard
shivergard / herokuenv.sh
Created January 25, 2017 21:36
Push local .env file details to Heroku
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
heroku config:set $line
done < "./.env"
<?php
/**
* This exemple shows how to parse base64 encoded images (submitted using Summernote), save them locally
* and replace the 'src' attribute in the submited HTML content
*
**/
use Intervention\Image\ImageManagerStatic as Image;
class PostController {
public function edit(){
// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
};
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {
@shivergard
shivergard / pache.sh
Last active August 29, 2015 14:16
Apache virtualHost create
#!/bin/bash
base_=$(pwd)
base_name="${base_##*/}"
DOMAIN=$base_name
host_id=$(( ( RANDOM ) + 1 ))
if [ -z "$1" ] ;
then