Skip to content

Instantly share code, notes, and snippets.

View paulmsmith's full-sized avatar
🫖
Need more tea

Paul Smith paulmsmith

🫖
Need more tea
View GitHub Profile
@paulmsmith
paulmsmith / Preferences.sublime-settings
Created November 23, 2015 07:51
sublime trailing whitespace setting
"trim_trailing_white_space_on_save": true
t-colour(#{nth(map-get($map,colour),1)},#{nth(map-get($map,colour),2)});
@paulmsmith
paulmsmith / hb_element.sublime-snippet
Created October 13, 2015 08:20
delonghi element snippet
<snippet>
<content><![CDATA[
<${1:div} class="{{ setModifiers "${2:baseClass}" modifiers }} {{ setClasses classes}} ${3:''}" {{ setData data }}>
${4:content}
</${1:div}>
]]></content>
<tabTrigger>de</tabTrigger>
</snippet>
@paulmsmith
paulmsmith / convert-to-webm.txt
Last active September 14, 2015 09:07
ffmpeg compress MP4s and convert to webm - commands
# install libvpx and ffmpeg
brew install libvpx
brew install ffmpeg --with-libvpx
# convert a single specific file "input.mp4" to webm "output.webm"
ffmpeg -i input.mp4 -c:v libvpx -b:v 1M -c:a libvorbis output.webm
# loop all mp4 files in current directory and convert to webm suffixed with "_compressed"
for file in *.mp4; do ffmpeg -i "$file" -c:v libvpx -b:v 1M -c:a libvorbis "${file%.mp4}"_compressed.webm; done
@paulmsmith
paulmsmith / SassMeister-input.scss
Created June 4, 2015 16:02
Generated by SassMeister.com.
// ----
// libsass (v3.2.4)
// ----
.c-nav {
position: relative;
&:before {
content: 'Menu';
display: inline-block;
@paulmsmith
paulmsmith / SassMeister-input.scss
Created June 4, 2015 15:59
Generated by SassMeister.com.
// ----
// libsass (v3.2.4)
// ----
.c-nav {
position: relative;
&:before {
content: 'Menu';
display: inline-block;
@paulmsmith
paulmsmith / bem_question.scss
Last active August 29, 2015 14:11
BEM nested blocks and modifiers question
// block one (the containing block)
.accordion {}
// block two (the nested BEM block)
.toggler {}
// when the accordion is toggled open I need to update it's
// appearance whilst adhearing to the BEM methodology. How?
// option one:
@paulmsmith
paulmsmith / bem_example_libsass.scss
Last active August 29, 2015 14:11
BEM libsass simple example
// mark-up example
// <div class="block block--sml"><span class="block__label">Text here</span></div>
.block { color: #000; }
// outputted css
.block {
color: #000;
}
@paulmsmith
paulmsmith / _tools.mixins.maintainaspect.scss
Created November 27, 2014 10:48
maintain aspect ratio mixin
// Maintain ratio mixin. Great for responsive grids, or videos.
// https://gist.github.com/brianmcallister/2932463
//
// $ratio - Ratio the element needs to maintain.
//
// Examples
//
// // A 16:9 ratio would look like this:
// .element {
// @include maintain-ratio(16 9);