Skip to content

Instantly share code, notes, and snippets.

View jeffsebring's full-sized avatar

Jeff Sebring jeffsebring

  • Spokane, Washington USA
View GitHub Profile
@jeffsebring
jeffsebring / nested_media_queries.scss
Created May 1, 2012 06:36
Compass Nested Media Queries
#sidebar {
width: 100%;
@media only screen and ( min-width: 480px; ) {
width: 33.33333%;
float: right;
}
}
#!/usr/bin/env ruby
# Author: Jeff Sebring
# Script: Zip DB
# Date: 6.2.2012
# Description: Dump and Zip a MYSQL Database and save like 6 keystrokes!
puts 'Enter the Database Name: '
db = gets.chomp
dump = `sudo mysqldump -u root -p #{db} | gzip > #{db}.sql.gz`
@jeffsebring
jeffsebring / archbang_install.sh
Created June 18, 2012 14:46
First Archbang Packages and Apps
#!/bin/bash
@jeffsebring
jeffsebring / archbang_init.sh
Created June 18, 2012 14:38
Initial Archbang Update
#!/bin/bash
cd /etc/pacman.d
cp mirrorlist mirrorlist.backup
rankmirrors -n 6 mirrorlist.backup > mirrorlist
pacman -Syy
pacman-key --init; pacman-key --populate archlinux
pacman -Syu --ignore filesystem && pacman -S filesystem --force && reboot
@jeffsebring
jeffsebring / dual_displays_1920.sh
Created June 18, 2012 15:14
Set Dual Displays DVI 1920x1080
#!/bin/bash
xrandr --output DVI-I-1 --mode 1920x1080 --output DVI-I-2 --mode 1920x1080 --right-of DVI-I-1
@jeffsebring
jeffsebring / _extend.sass
Created June 20, 2012 16:23
Render Extended Sass Classes
.position-relative
position: relative
.float-left
float: left
.float-right
float: right
.float-none
public static function filters( $filter = null, $value = null )
{ global $Render;
$value = apply_filters( 'render_' . $filter, $value );
if ( ! empty( $Render->template[ 'view' ] ) )
$filters[] = $Render->template[ 'view' ];
if ( ! empty( $Render->template[ 'post_type' ] ) )
$filters[] = $Render->template[ 'post_type' ];
@jeffsebring
jeffsebring / mount_luks.sh
Created June 22, 2012 19:38
Mount Luks drive
mkdir /media/home
sudo cryptsetup luksOpen /dev/sda2 home
sudo mount /dev/mapper/home /media/home
@jeffsebring
jeffsebring / jeffsebring.com.nginx.conf
Created July 26, 2012 07:27
Example nginx config
server {
server_name www.jeffsebring.com;
rewrite ^/(.*)$ http://jeffsebring.com/$1 permanent;
}
server {
#port 8080;
server_name jeffsebring.com;
access_log /PATH/logs/access/jeffsebring.com_access.log;
error_log /PATH/logs/errors/jeffsebring.com_error.log;
@jeffsebring
jeffsebring / custom_post_type.php
Created October 18, 2012 22:29
Create Custom Post Type
<?php
add_action( 'init', function()
{
register_post_type( 'code',
array(
'labels' => array(
'name' => _x( 'Code', 'post type general name' ),