Skip to content

Instantly share code, notes, and snippets.

@triple-j
triple-j / rpi-install-cups.sh
Last active March 12, 2016 03:39
Setup RaspPI as a print server
#!/bin/sh
sudo apt-get install --yes cups cups-pdf hplip
sudo usermod -a -G lpadmin $USER
sudo usermod -a -G lp $USER
sudo cupsctl --remote-any
sudo /etc/init.d/cups restart
@triple-j
triple-j / rpi-misc-setup.sh
Last active March 7, 2016 04:33
Misc RaspPI fixes
#!/bin/sh
sudo apt-get update
# reset ping's capabilities
sudo apt-get install --reinstall --yes iputils-ping
# missing programs
sudo apt-get install --yes rsync screen screenie caca-utils lynx sshfs
@triple-j
triple-j / rpi-keyboard-locales.sh
Created March 6, 2016 01:05
Fix raspberry pi keyboard layout and other localization data
#!/bin/sh
sudo dpkg-reconfigure keyboard-configuration
sudo dpkg-reconfigure locales
sudo dpkg-reconfigure tzdata
sudo reboot
@triple-j
triple-j / rpi-setup-main-user.sh
Last active March 6, 2016 00:52
Setup main user account on Raspberry PI
#!/bin/sh
NEWUSER=$1
if [ -z "$NEWUSER" ]; then
read -p "New User: " NEWUSER
fi
# add main user account
sudo adduser $NEWUSER
@mixin input-placeholder {
&::-webkit-input-placeholder {
@content;
}
&:-moz-placeholder { // Firefox 18-
@content;
}
&::-moz-placeholder { // Firefox 19+
@content;
}
@triple-j
triple-j / _bt_clearfix.scss
Created September 4, 2015 18:09
*Beat That* ClearFix!
// http://cssmojo.com/latest_new_clearfix_so_far/
// For those wondering about the class name… It stands for *Beat That* ClearFix! :)
@mixin bt-clearfix {
&:after {
content:"";
display:table;
clear:both;
}
}
%bt-clearfix {
@triple-j
triple-j / tint-mixin.scss
Created July 23, 2015 20:27 — forked from stefthoen/tint-mixin.scss
Sass tint mixin
// Add percentage of white to a color
@function tint($color, $percent) {
@return mix(white, $color, $percent * 1%);
}
// Add percentage of black to a color
@function shade($color, $percent) {
@return mix(black, $color, $percent * 1%);
}
if (Element && !Element.prototype.matches) {
Element.prototype.matches = Element.prototype.matchesSelector ||
Element.prototype.mozMatchesSelector ||
Element.prototype.msMatchesSelector ||
Element.prototype.oMatchesSelector ||
Element.prototype.webkitMatchesSelector;
}
@triple-j
triple-j / _menu_flyouts.scss
Created June 4, 2015 22:02
Flyout Menu SCSS mixins
///
// Flyout Menu CSS (Don't modify below this line!!!)
//
//
// Use the following code to apply these styles:
//
// @include flyout-horizontal;
// -or-
// @include flyout-vertical;
@triple-j
triple-j / email_regex.txt
Last active August 29, 2015 14:20
Simple Email Name Extract REGEX
/(?:\"?([^\"]*)\"?\s+<?)?([^<>]*)(?:>)?/