Skip to content

Instantly share code, notes, and snippets.

View ddanninger's full-sized avatar

Dominik Danninger ddanninger

View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active May 16, 2024 16:51
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@danwit
danwit / node_acl_example.js
Created April 26, 2014 00:22
Authorization with node_acl + mongo + express
/**
* Simple node_acl example with mongoDB and expressjs
*
* Usage:
* 1. Start this as server
* 2. Play with the resoures
*
* Show all permissions (as JSON)
* http://localhost:3500/info
*
@OneHoopyFrood
OneHoopyFrood / PaperjsRuler
Created July 1, 2014 17:58
Creates a ruler of the specified dimensions using paper.js (Written in paperscript)
// Paper.js Ruler object.
// Creates a ruler of the specified dimensions using paper.js
function Ruler(params) {
// Length of the ruler (px)
this.lengthOfRuler = params.lengthOfRuler;
// Space between ticks (px)
this.tickSpacing = params.tickSpacing;
// Show the number on the [nth] tick
this.numOnTick = params.numOnTick;
// Tick height (px)
@chrissimpkins
chrissimpkins / gist:5bf5686bae86b8129bee
Last active March 6, 2023 00:10
Atom Editor Cheat Sheet: macOS

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@WebReflection
WebReflection / ai2svg.md
Last active March 5, 2024 10:43
Transform AI to SVG, requires Inkscape

Save this file as ai2svg, make it executable via chmod +x ai2svg then run it optionally passing the folder to look for.

It will convert in that folder, or the current one, all .ai files into .svg

#!/usr/bin/bash

createsvg() {
  local margin="$1"
 local d
@robhemsley
robhemsley / Inkscape_install.sh
Created March 2, 2016 19:06
AWS Linux AMI - Inkscape Install
#!/bin/bash
set -e
#####################
# Inkscape Install #
#####################
# Script installs Inkscape from source for Amazon AMI Instance (CentOS/REHL)
#
# Works as of 01/03/2016
@robinbastien
robinbastien / main.js
Last active January 23, 2018 10:13
CSS Scroll Reveals (Simple WOW.js alternative)
// Get height of window and set an offset from bottom
var winHeight = $(window).height();
var offset = 50;
// Recalc height of window in case of resize
$(window).bind('resizeEnd', function() {
winHeight = $(window).height();
});
// When we scroll we do some checks...
@DirkWolke
DirkWolke / searchbox.html
Created October 14, 2016 12:34
#TYPO3 #FLUID searchbox-form for #indexed_search
<f:form class="searchbox form-inline"
pageUid="{pidSearch}"
method="post"
noCacheHash="true"
absolute="0"
action="search"
extensionName="IndexedSearch"
pluginName="pi2"
controller="Search"
>