Skip to content

Instantly share code, notes, and snippets.

View mojoaxel's full-sized avatar
🏠
Working from home

Alexander Wunschik mojoaxel

🏠
Working from home
View GitHub Profile
@kerryrodden
kerryrodden / .block
Last active March 1, 2024 18:46
Sequences sunburst (d3 v4)
license: apache-2.0
@mandiwise
mandiwise / Update remote repo
Last active May 2, 2024 08:59
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@WickyNilliams
WickyNilliams / bind.js
Last active December 6, 2020 15:30
Super simple one-way data-binding
/**
* follows a path on the given data to retrieve a value
*
* @example
* var data = { foo : { bar : "abc" } };
* followPath(data, "foo.bar"); // "abc"
*
* @param {Object} data the object to get a value from
* @param {String} path a path to a value on the data object
* @return the value of following the path on the data object
@mojoaxel
mojoaxel / server.js
Last active January 23, 2016 18:23
simple static node.js webserver
var http = require("http");
var url = require("url");
var fs = require("fs");
var port = process.argv[2] || 8080;
var contentTypes = {
'ico': 'image/x-icon',
'html': 'text/html',
'js': 'application/javascript',
'json': 'application/json',
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@danielpradilla
danielpradilla / index.html
Last active August 27, 2020 11:40
HTML5 skeleton
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
</head>
<body>
<h1>Hello, world</h1>
<script src="http://code.jquery.com/jquery.js"></script>
@willurd
willurd / web-servers.md
Last active May 6, 2024 09:12
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@vodolaz095
vodolaz095 / print.js
Last active August 30, 2023 20:47
Print for NodeJS using CUPS backend
var ipp = require('ipp'); //get it from there - https://npmjs.org/package/ipp - $npm install ipp
var request = require('request'); //get it from there - https://npmjs.org/package/request - $npm install request
var fs = require('fs');
function getPrinterUrls(callback) {
var CUPSurl = 'http://localhost:631/printers';//todo - change of you have CUPS running on other host
request(CUPSurl, function (error, response, body) {
if (!error && response.statusCode == 200) {
var printersMatches = body.match(/<TR><TD><A HREF="\/printers\/([a-zA-Z0-9-^"]+)">/gm);//i know, this is terrible, sorry(
var printersUrls = [];
@adammw
adammw / buildnode.sh
Last active March 5, 2016 16:44
Node.js for Raspberry Pi Packaging Script
#!/bin/sh
## Node.js for Raspberry Pi Packaging Script
## =========================================
## Execute this script from within node.js git repo
## Use like this:
## ~/node/$ VERSION=v0.10.0 ./buildnode.sh
if [ -z $VERSION ]; then
echo "set the VERSION first"
exit 1
@jayj
jayj / flexbox.less
Last active November 20, 2023 04:51
CSS3 Flexbox - LESS Mixins
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox