Skip to content

Instantly share code, notes, and snippets.

View teamgroove's full-sized avatar

René teamgroove

  • SMILEUPPS-F091BA1E67
  • -`ღ´-
View GitHub Profile
function _isEvent(prop) {
if (0 !== prop.indexOf('on')) {
return false;
}
return true;
}
function _getEvents(obj) {
version: '3.1'
services:
reverse-proxy:
image: traefik # The official Traefik docker image
command: --api --docker # Enables the web UI and tells Traefik to listen to docker
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
@eliashussary
eliashussary / metabase-postgres.docker-compose.yml
Created December 11, 2018 16:45
A docker-compose file for metabase with postgres.
version: "3"
services:
postgres-db:
image: postgres
restart: always
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: postgres
@dmarmugi
dmarmugi / stopCFAppsInSpace.sh
Created August 23, 2017 20:15
Stop all Cloud Foundry apps in a space
cf apps | grep started | awk '{print $1}{system("cf sp " $1)}'
@crittermike
crittermike / wget.sh
Last active March 28, 2025 18:44
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@bjunc
bjunc / graphql-axios.js
Last active January 12, 2024 05:34
application/graphql vs application/json using axios
let input = { first_name: 'Foo', last_name: 'Bar' };
// application/graphql example
/* eslint-disable no-unused-vars */
let configGraphQL = {
url: '/graphql',
method: 'post',
headers: { 'Content-Type': 'application/graphql' },
data: `mutation { user(id: 1, input: ${ JSON.stringify(input) }){ full_name } }`
};
@blakek
blakek / queryStringParse.js
Last active January 22, 2021 12:47
Parse query string in browser (<=ES5)
// Deserialize query string to object
// Example: var queryParams = queryStringParse(window.location.search)
function queryStringParse (str) {
var ret = Object.create(null)
if (typeof str !== 'string') {
return ret
}
str = str.trim().replace(/^(\?|#|&)/, '')
package main
import (
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
_ "github.com/mattn/go-sqlite3"
)
type Users struct {
Id int `gorm:"AUTO_INCREMENT" form:"id" json:"id"`
@phusick
phusick / server.js
Created November 18, 2016 11:38
Webpack Dev Server with Proxy
/* eslint-disable no-console */
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const cookieParser = require('cookie-parser');
const config = require('./webpack.config')();
const PORT = require('../../package.json').config.port;
function relayRequestHeaders(proxyReq, req) {
console.log('💥💥💥 request 💥💥💥');