Skip to content

Instantly share code, notes, and snippets.

View roryashfordbentley's full-sized avatar
🌭
Wranglin'

Rory Ashford-Bentley roryashfordbentley

🌭
Wranglin'
View GitHub Profile
@roryashfordbentley
roryashfordbentley / htaccess.txt
Created February 23, 2017 10:51
Use assets from liveserver without having to download them all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mysite/
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^app/uploads/(.*)$ http://mysite.com/app/uploads/$1 [R=301,L]
</IfModule>
@roryashfordbentley
roryashfordbentley / Package.json
Last active June 9, 2016 12:41
Package.json example with some set variables
{
"name": "FlexbonesBuild",
"version": "5.0.0",
"description": "Watch sass,js and deploy",
"author": "Rory Ashford <[email protected]>",
"config": {
"theme": "wp-content/themes/flexbones",
"sass":"wp-content/themes/flexbones/assets/sass/style.scss",
"sassfolder":"wp-content/themes/flexbones/assets/sass",
"css":"wp-content/themes/flexbones/style.css",
@roryashfordbentley
roryashfordbentley / dots.js
Last active November 12, 2015 09:54
First attempt at OOJS
/**
* dots.js
* Create dots for the explosion animation
* on the homepage
*/
/**
* generates random dots within a circular outline
*
@roryashfordbentley
roryashfordbentley / hehadnodebodytogowith.js
Created August 6, 2015 15:39
Stuck trying to get my noggin around callbacks
/**
* getWpVersionInfo - gets the lates WordPress version and download links
* @param {Function} cb Callback function that is neccessary for data and errors
* @return {Object} Thisreturns selected data extracted from the api/json request
*/
function getWpVersionInfo(cb) {
// Pass the API details to the http.get method
return http.get({
host: 'api.wordpress.org',
path: '/core/version-check/1.7/'
@roryashfordbentley
roryashfordbentley / flextype.css
Last active August 29, 2015 14:20
Readable responsive typography.
.content {
font-size: 1.2rem;
line-height: 1.5; }
@media (min-width: 800px) and (max-width: 900px) {
.content {
font-size: 1.4rem; } }
@media (min-width: 1000px) {
.content {
font-size: 1.8rem;
line-height: 1.3; } }
@roryashfordbentley
roryashfordbentley / SassMeister-input.scss
Created April 28, 2015 09:07
Generated by SassMeister.com.
// ----
// libsass (v3.1.0)
// ----
// S/Small
$s: (null null);
// M/Medium
$m: (800px 900px);
@roryashfordbentley
roryashfordbentley / gist:1aaa749385474b265a1d
Created March 19, 2015 10:12
building with package.json
{
"name": "bob the builder",
"version": "0.1.0",
"description": "Build all the things",
"author": "Rory Ashford <[email protected]>",
"scripts": {
"compile-sass": "node-sass --output-style compressed assets/sass/style.scss style.css && autoprefixer --map style.css",
"browserify-js": "browserify assets/js/scripts.js -o scripts.js",
"uglify-js": "uglifyjs scripts.js -o scripts.min.js -c",
"process-js": "npm run browserify-js && npm run uglify-js",
@roryashfordbentley
roryashfordbentley / Sass DocBlockr
Last active August 29, 2015 14:15
Dockblockr example for sass mixins and functions
/**
* testFoo
*
* @param {[int]} $foo [description]
* @param {[int]} $bar [description]
*/
@mixin testFoo($foo,$bar){
width: $foo;
height: $bar;
}
@roryashfordbentley
roryashfordbentley / fixed aspect ratio
Created January 4, 2015 17:44
Sass mixin to make element a fixed aspect ratio
/**
* _aspect-ratios.scss
*
* Mixin to display block level elements at
* fixed aspect ratios using padding top
* on an :after pseudo element.
*/
@mixin aspect-ratio($h,$v){
@roryashfordbentley
roryashfordbentley / grunt-vs-npm
Last active December 30, 2020 20:23
Grunt vs NPM
/**
* After reading a few articles
* (http://substack.net/task_automation_with_npm_run)
* (http://blog.keithcirkel.co.uk/why-we-should-stop-using-grunt/)
* and discussing with other developers on Twitter
* (@benhowdle, @_mikefrancis,@zachmayberry)
* I put together a replacement of my current Grunt workflow using npm via
* package.json using npm cli plugins instead of grunt specific plugins.
*
* I found that several grunt plugins were just wrappers for npm mopdules,