Skip to content

Instantly share code, notes, and snippets.

View macx's full-sized avatar
🚲

David Maciejewski macx

🚲
View GitHub Profile
@macx
macx / amznshortener.js
Created November 18, 2011 08:23 — forked from nathos/amznshortener.js
AmznShortener - Javascript bookmarket source for an Amazon.com short-link generator.
(function(){
var aff = 'macx-21'; // replace 'macx-21' with your Amazon affiliate ID, including the '-20'
if (!document.getElementById('ASIN')) {
alert('Konnte keine Amazon-Produkt-ID finden');
return;
}
var asin = document.getElementById('ASIN').value;
prompt(
'Kurz-URL des Amazon-Produkts:',
'http://amazon.de/dp/' + asin + '/?tag=' + aff);
@macx
macx / dabblet.css
Created May 10, 2012 07:05
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background: #f5f5f5;
font-family: Helvetica, Arial;
margin: 50px;
font-size: 20px;
min-height: 100%;
@macx
macx / dabblet.css
Created May 23, 2012 10:40 — forked from ludviglindblom/dabblet.css
CSS3 Border-Radius with Border - Circle Avatars
/**
* CSS3 Border-Radius with Border - Circle Avatars
*/
/* General Styles */
body { background: url(http://subtlepatterns.com/patterns/white_texture.png);
font: 100 14px sans-serif;
color: #444555; text-shadow: 0 2px white;
text-align: center;
@macx
macx / dabblet.css
Created July 22, 2013 09:00
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background: #fff;
min-height: 100%;
}
.container {
display: -webkit-flex;
<div class="box">
<div class="box__inner is-vertical-aligned">
VERTICAL ALIGNED
</div>
</div>
@macx
macx / open-links-in-a-new-tab.js
Last active August 29, 2015 13:57
Open Links in a new tab
@macx
macx / fs-mkdir-paranet.js
Created April 15, 2014 06:52
Recursively created directories along a path. It will create each dir in given string ´foo/bar/doo´. Source: http://goo.gl/bvcJk
var fs = require('fs');
var path = require('path');
fs.mkdirParent = function(dirPath, mode, callback) {
//Call the standard fs.mkdir
fs.mkdir(dirPath, mode, function(error) {
//When it fail in this way, do the custom steps
if (error && error.errno === 34) {
//Create all the parents recursively
fs.mkdirParent(path.dirname(dirPath), mode, callback);
@macx
macx / SassMeister-input.scss
Created July 30, 2014 06:32
Generated by SassMeister.com.
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
$sun-index-colors: (
'10' #FCC24E,
'15' #F7A722,
'20' #F7A722,
'30' #D95716,
@macx
macx / 01.httpd.sh
Last active August 29, 2015 14:10
Set-up Amazon LAMP
# Connect to LAMP Server using a id_rsa
ssh -i ~/Projects/path-to/id_rsa username@servername
sudo bash # Set the correct user rights for this session
cd /var/www/ # Change directory to the parent of Doc Root
chown -R username html # Assign Doc Root to the user `username`
chgrp wheel html # Set Apache Group to the `html` Folder
# Apache im Bedarfsfall neu starten
sudo service httpd restart
@macx
macx / google-spreadsheet-id-converter.js
Last active August 29, 2015 14:11
Convert Google Spreadsheet gid to wid and vice versa (Base 36)
/**
* Base 36 convert Google Worksheet Id (wid)
* to Google Spreadsheet ID (gid)
*
* @param string wid [example: `od6` is equal sheet `0`]
* @return string [gid]
*/
function wid2gid(wid) {
return parseInt(String(wid), 36)^31578;
}