Skip to content

Instantly share code, notes, and snippets.

View frank-dspeed's full-sized avatar
🇩🇪
I Engineer

Frank Lemanschik frank-dspeed

🇩🇪
I Engineer
View GitHub Profile
apm install
emmet
javascript-snippets
git-plus
iamdone-atom
color-picker
code-peek
toggle-quotes
atom-ternjs
terminal-plus
# Get Root
sudo su -
# Install dev tools
yum groupinstall -y 'Development Tools'
# Install NodeJS + ImageMagick + php5.4 + httpd
curl --silent --location https://rpm.nodesource.com/setup_7.x | bash -
yum install -y nodejs ImageMagick ImageMagick-devel php-devel php-pear httpd php
# php5.4 imagemagick integration
echo | pecl install imagick
echo "extension=imagick.so" > /etc/php.d/imagick.ini
@frank-dspeed
frank-dspeed / Frontend Code
Last active February 4, 2017 11:17
Some Frontend Code for Mark2733
/*
v0.0.5
- Change Log Start Able via ControlPanel
*/
var controlPanel = $('<div id="cPanel">')
.css('position', 'absolute')
.css('background-color', 'black')
.css('color', 'white')
.css('z-index', 2147483647)
@frank-dspeed
frank-dspeed / docker-cleanup
Created February 21, 2017 23:42 — forked from wdullaer/docker-cleanup
Cleanup unused Docker images and containers
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'
@frank-dspeed
frank-dspeed / install.sh
Created February 21, 2017 23:42 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
"use strict";
var page = require('webpage').create(),
system = require('system'),
address, output, size, pageWidth, pageHeight;
if (system.args.length < 3 || system.args.length > 5) {
console.log('Usage: pdf.js URL filename [paperwidth*paperheight|paperformat] [zoom]');
console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"');
console.log(' image (png/jpg output) examples: "1920px" entire page, window width 1920px');
console.log(' "800px*600px" window, clipped to 800x600');
@frank-dspeed
frank-dspeed / sed cheatsheet
Created January 19, 2017 22:36 — forked from freewind/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@frank-dspeed
frank-dspeed / gist:e90ce6e98c8e1aa9d60d0fd59e734774
Created April 26, 2017 19:22
Accessing a exported global module
System.import('my-module-path').then(function(module) { window.MyExportName = module.myExportName })
@frank-dspeed
frank-dspeed / client.js
Created May 22, 2017 10:48 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@frank-dspeed
frank-dspeed / compose.js
Created June 24, 2017 09:23
compose.js a js object mixin function
'use strict';
function getPrototypeChain(prototype)
{
var chain = [];
while(prototype)
{
chain.push(prototype);
prototype = Object.getPrototypeOf(prototype);