Skip to content

Instantly share code, notes, and snippets.

View cbracco's full-sized avatar

Chris Bracco cbracco

View GitHub Profile

Bash

#!/bin/bash

cd $ROOT_DIR
DOT_FILES="lastpass weechat ssh Xauthority"

for dotfile in $DOT_FILES; do conform_link "$DATA_DIR/$dotfile" ".$dotfile"; done
@cbracco
cbracco / gist:7ec99d9da5e2a8ac8ed8
Created March 11, 2015 02:43
Convert MP4 to WEBM & OGV using ffmpeg on OSX
ffmpeg -i app/_assets/videos/bg-home-team.mp4 -an -qmax 25 -threads 2 app/_assets/videos/bg-home-team.webm
ffmpeg -i app/_assets/videos/bg-home-team.mp4 -an -c:v libtheora -q:v 7 -threads 2 app/_assets/videos/bg-home-team.ogv
@cbracco
cbracco / Instant text editor in the browser
Last active December 17, 2016 23:04
A fun little script you paste into your browser's address bar for an instant, no-frills text editor.
data:text/html, <body contenteditable style="background-color: #f8f3e8;font-family:Garamond, Georgia, serif;font-size:1.333rem;line-height:1.5;max-width:36rem;margin:0 auto;padding:3rem 1.5rem;">

Keybase proof

I hereby claim:

  • I am cbracco on github.
  • I am cbracco (https://keybase.io/cbracco) on keybase.
  • I have a public key whose fingerprint is EF4A 7274 72A4 0D3B 7E3E 3A3F C88D EC30 C4E8 DB60

To claim this, I am signing this object:

@cbracco
cbracco / defaults.css
Created March 11, 2016 18:22
Example CSS variable defaults
/**
* Custom Properties
*/
:root {
/* Breakpoints */
--breakpoint-xxs: 320px;
--breakpoint-xs: 480px;
@cbracco
cbracco / WordPress nginx rewrites
Last active December 20, 2015 07:49
Include these in your Nginx config, before the PHP fastcgi block (location ~ \.php$).
location ~ ^/assets/(img|js|css)/(.*)$ {
try_files $uri $uri/ /wp-content/themes/yourthemename/assets/$1/$2;
}
location ~ ^/plugins/(.*)$ {
try_files $uri $uri/ /wp-content/plugins/$1;
}
@cbracco
cbracco / gist:495db602d77ccca45ee5
Created January 18, 2015 23:14
Starter index.html
<!DOCTYPE html>
<!--[if lt IE 9]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if IE 9]> <html class="no-js lt-ie10 ie9"> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<!-- Meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="ClearType" content="true">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@cbracco
cbracco / .maintenance
Created February 6, 2014 21:09
WordPress Maintenance Mode
<?php
function is_user_logged_in() {
$loggedin = false;
foreach ( (array) $_COOKIE as $cookie => $value ) {
if ( stristr($cookie, 'wordpress_logged_in_') )
$loggedin = true;
}
return $loggedin;
}
if ( ! stristr($_SERVER['REQUEST_URI'], '/wp-admin') && ! stristr($_SERVER['REQUEST_URI'], '/wp-login.php') && ! is_user_logged_in() )