Skip to content

Instantly share code, notes, and snippets.

View macx's full-sized avatar
🚲

David Maciejewski macx

🚲
View GitHub Profile
@macx
macx / What are you using.md
Last active January 10, 2020 16:04
These are the libraries and tools I am using.

The answer of: What are you using?

Often my students and followers ask me, what tools and libraries I am using and why. Here is a small but growing list of some of them.

Shortlink: bit.ly/what-are-you-using

General Questions My Answer
Are you using a CSS preprocessor? Yes, I'm using Sass
Isn't a CSS postprocessor better? Depends. I'm using Sass and PostCSS together
@macx
macx / SassMeister-input.scss
Created January 26, 2016 17:46
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
$layout-breakpoints: (
small: 480px,
medium: 600px,
large: 1024px,
xlarge: 1300px,
xxlarge: 1600px,
@macx
macx / README.md
Last active October 17, 2019 12:44
git CheatSheet

git CheatSheet

Remove a file from last commit

# put files back to staging
$ git reset --soft HEAD^

# unstage the file
@macx
macx / Flexible element floating.markdown
Created June 22, 2015 05:11
Flexible element floating

Flexible element floating

Don't write CSS for floated images for every size you need any more. Just use this approach to align your media – left or right.

A Pen by David Maciejewski on CodePen.

License.

@macx
macx / README.md
Created June 10, 2015 07:31
Put SSH key on a remote server for authentification
$ cat ~/.ssh/id_rsa.pub | ssh user@foo.bar 'cat >> .ssh/authorized_keys'
@macx
macx / README.md
Last active August 29, 2015 14:19
Setup Amazon Server

Login and Configuration

ssh -i ~/.ssh/your_key_rsa username@server.net
sudo bash              # Set User Admin privileges 
cd /var/www/           # Change to Doc-Root
chown -R username html # Give privileges to Doc-Roo
chgrp wheel html       # Set Apache-group
 
# Restart Apache, if needed
@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;
}
@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 / 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 / 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);