The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
#!/bin/bash | |
# Ubuntu kernel cleanup: | |
# Save the 2 latest kernels and remove the old | |
IMAGES=($(dpkg --get-selections | grep "linux-image-[[:digit:]].*" | tr "\t" ";" | cut -d ";" -f1)) | |
HEADERS=($(dpkg --get-selections | grep "linux-headers-[[:digit:]].*" | tr "\t" ";" | cut -d ";" -f1)) | |
I_LEN=${#IMAGES[@]} | |
H_LEN=${#HEADERS[@]} |
import {Directive, ElementRef, EventEmitter, Input, Output} from '@angular/core'; | |
/** | |
* The infinite scroll directive. | |
* Providing a number on input offsets the distance from the bottom | |
*/ | |
@Directive({ | |
selector: '[infiniteScroll]', | |
host: { | |
'(scroll)': 'scroll($event)' |
import {AfterViewInit, Directive, ElementRef, Input, Renderer} from '@angular/core'; | |
/** | |
* ng2 FitText directive. | |
*/ | |
@Directive({ | |
selector: '[fitText]' | |
}) | |
export class FitText implements AfterViewInit { | |
private factor: number; |
function sentencesArray (text) { | |
return text | |
.replace(/([\s,]?[\d,-]?([A-Z][a-z]{3,}|[a-z]{2,}|[0-9])[.?!…\n]+([\s\n"]))/g, '$1|') | |
.split('|') | |
.map(s => s.trim()) | |
.filter(s => s) | |
} |
#!/bin/bash | |
FONT_NAME="$1" | |
FILE_NAME=$(echo $FONT_NAME | tr '[:upper:]' '[:lower:]' | tr ' ' '-') | |
URL_NAME=$(echo $FONT_NAME | tr ' ' '+') | |
FILE=$FILE_NAME"-font.css" | |
FONT_FOLDER="web-font" | |
AGENT_WOFF="Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko" | |
AGENT_WOFF2="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like $ |
/*! | |
* Clamp.js 0.5.1 | |
* | |
* Copyright 2011-2013, Joseph Schmitt http://joe.sh | |
* Released under the WTFPL license | |
* http://sam.zoy.org/wtfpl/ | |
*/ | |
/** | |
* Clamps a text node. |
function highlightSentences (sentences) { | |
const highlights = [] | |
const body = document.body | |
const contentNodes = gatherTextNodes(body) | |
sentences.forEach(sentence => { | |
const range = document.createRange() | |
let rangeSentence = sentence.toLowerCase() | |
let start = false |
#!/bin/bash | |
git log \ | |
--pretty=format:"%at|%s" \ | |
--reverse \ | |
--no-merges \ | |
> commitmsg.txt | |
gource \ | |
-1920x1080 \ |