This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
set expandtab | |
set shiftwidth=4 | |
set softtabstop=4 | |
filetype plugin indent on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
convert $1 \ | |
\( -clone 0 -resize 16x16 \) \ | |
\( -clone 0 -resize 24x24 \) \ | |
\( -clone 0 -resize 32x32 \) \ | |
\( -clone 0 -resize 48x48 \) \ | |
\( -clone 0 -resize 64x64 \) \ | |
favicon.ico |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Running edge detection with imagemagick..." | |
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "/tmp/whiteboard.png" | |
echo "Scaling down to 1800px max" | |
convert /tmp/whiteboard.png -resize 1800x1800 /tmp/whiteboard2.png | |
echo "Force colors to primaries with imagemagick" | |
convert /tmp/whiteboard2.png -separate -threshold 50% -combine /tmp/whiteboard3.png | |
echo "Converting to svg with autotrace..." | |
autotrace -color-count 4 -output-format svg -despeckle-level 1 -remove-adjacent-corners /tmp/whiteboard3.png > $2.svg | |
echo "Cleaning up..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
host $1 | |
IP=$(host -t A $1 | awk '{ print $NF }') | |
PTR=$(host $IP | awk '{ print $NF }') | |
echo "$1 is hosted on $PTR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import re, datetime, sys | |
# Clone https://gist.github.com/MartijnBraam/04dd7039ad5fddcb02a6 | |
# Save your page schedule page to current directory as schedule.html | |
# ./schedule.py < schedule.html > schedule.ical | |
# | |
# Or use curl: | |
# curl -o - https://amsterdam2014.drupal.org/user/YOUR-USER-ID/schedule | ./schedule.py > schedule.ical |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#aside .block { | |
border: 1px solid #CCC; | |
border-radius: 4px; | |
box-shadow: 1px 2px 6px 0 rgba(0,0,0,0.15); | |
margin-bottom: 22px; | |
} | |
#dreditor-clone-button { | |
background: white; | |
border: 0px solid white; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Use with: https://www.drupal.org/project/drush_entity | |
For example:: | |
$ drush entity-type-read --format=json --include-fieldapi | content-type-documentation.py > documentation.md | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
#include <util/delay.h> | |
void init_io(void) | |
{ | |
// 1 = output, 0 = input | |
DDRB = 0b11111111; // All outputs | |
DDRC = 0b11111111; // All outputs | |
DDRD = 0b11111110; // PORTD (RX on PD0). Just for demo | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface renderable { | |
function render(); | |
} | |
abstract class Html implements renderable{ | |
protected $name; | |
protected $attributes = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: {} | |
--- | |
package: | |
name: | |
- aiccu | |
- arduino | |
- arduino-mk | |
- bmon | |
- cpuburn | |
- curl |
OlderNewer