Skip to content

Instantly share code, notes, and snippets.

View webinista's full-sized avatar

Tiffany Brown webinista

View GitHub Profile
@webinista
webinista / genpass.php
Created December 18, 2014 19:30
Command-line PHP script for generating random-ish passwords.
<?php
/*
* Designed to be used on the command line.
* php genpass.php [arg1] [arg2] ...
* Accepts up to three parameters:
* --length or -l = length of the password
* --specialchars or -s = whether to include punctuation in generating the password
* --unique or -u = whether to prevent repeated characters in a string
*
*/
@webinista
webinista / gist:3adbd4ce1b95566d5d13
Created March 10, 2015 16:21
Rewrite base dir and all URLs to subdir
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/$ /content/ [L]
RewriteRule ^(.*)$ /content/$1 [L]
</IfModule>
# END WordPress
@webinista
webinista / matchMediaAddEventListener.js
Created March 24, 2015 17:33
Use addEventListener/removeEventListener instead of
/*
CSSOM View[1] initially defined addListener() and removeListener() methods for the
MediaQueryList interface (the object type returned by matchMedia()). Later, the
spec changed and now MediaQueryList uses addEventListener/removeEventListener
and MediaQueryList is really a change event in disguise.
Chrome and Opera have made this change. Other browsers are still working on it.
This code snippet makes it possible to use addEventListener/removeEventListener
in (almost) every browser (the usual caveats about browser support apply).
@webinista
webinista / bdYXrO.markdown
Last active August 29, 2015 14:23
Animating SVG elements
@webinista
webinista / multiple-columns.scss
Last active August 29, 2015 14:24
Mixins for working with Multiple Column Layout
// See current support chart http://caniuse.com/#feat=multicolumn
/*
Column mixins by Tiffany Brown (@webinista / webinista.com)
Public domain licensed, because, really who couldn't come up with this on their own?
It's not required, but I'd appreciate you letting me know if you found these useful :-).
*/
@mixin column-count($value) {
-moz-column-count: $value;
@webinista
webinista / index.html
Created August 9, 2015 05:18
Using input[type=range] to create toggles
<h1>Using <code>input[type=range]</code> to create toggles</h1>
<p>
<input type="range" value="0" min="0" max="1" step="1">
</p>
@webinista
webinista / long-button.css
Last active August 29, 2015 14:27
Long buttons
body {
font: 200 18px / 1.5 Arial,sans-serif;
}
.long-button {
box-sizing: border-box;
background: rgba(153,50,204,.95);
color: whitesmoke;
font: inherit;
border: 1px solid transparent;
text-align: left;
@webinista
webinista / Placeholder clearing
Created October 7, 2015 02:31
Faux placeholder clearing with CSS
:focus::-webkit-input-placeholder{
color: transparent;
}
:focus::-moz-placeholder {
color: transparent;
}
:focus:-ms-input-placeholder {
color: transparent;
@webinista
webinista / has3d.js
Created September 4, 2012 21:42
Testing for CSS 3D Transforms Support
function has3d(){
var el = document.createElement('p'), t, has3d,
transforms = {
'WebkitTransform':'-webkit-transform',
'OTransform':'-o-transform',
'MSTransform':'-ms-transform',
'MozTransform':'-moz-transform',
'transform':'transform'
};
@webinista
webinista / datalist.html
Last active October 12, 2015 14:48
Datalist in action
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title><datalist in actino></title>
<link rel="stylesheet" href="s.css" media="screen">
<style media="screen">
p{
font: bold 100% / 1.5 sans-serif;
}