Skip to content

Instantly share code, notes, and snippets.

@Ondreas
Ondreas / Menu 'Navicon' with CSS3 Gradient.html
Created September 19, 2013 13:17
Three Line Menu 'Navicon' CSS3 Gradient
<html>
<head>
<title>Three Line Menu 'Navicon' with CSS3 Box-Shadow</title>
<!-- http://css-tricks.com/three-line-menu-navicon/ -->
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<style type="text/css">
.gradient-menu {
padding-left: 1.25em;
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@blockloop
blockloop / gist:5600341
Created May 17, 2013 16:41
Plain text Jekyll excerpt plugin. How it works: - Reads markdown into html - Converts the html to plain text - grabs the first X characters (default 160) - adds to the post (use post.excerpt) Reasons I wrote it: - supports the ability to add your own excerpt in the front matter (does not override) - creates text-only excerpt for a footer message…
require 'maruku'
require 'nokogiri'
module Jekyll
class ExcerptBuilder < Generator
safe true
priority :high
EXCERPT_LENGTH = 160
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@cball
cball / gist:2076871
Created March 18, 2012 16:28
Copy production heroku db to staging
# backup current production db
$ heroku pgbackups:capture --app myapp-production
# restore to staging
$ heroku pgbackups:restore DATABASE `heroku pgbackups:url --app myapp` --app myapp-staging
@aemkei
aemkei / LICENSE.txt
Last active April 12, 2024 21:27 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@refractalize
refractalize / decrypt.rb
Created January 4, 2012 20:11
Decrypt HTTP Live Streaming TS files
def read_m3u8(m3u8)
File.open(m3u8, 'r') do |file|
keyfile = nil
iv = 0
file.each_line do |line|
line.chomp!
if line =~ /^#EXT-X-KEY:METHOD=AES-128,URI="(.*?)"(,IV=0x(.*))?/
keyfile = $1
if $2
iv = $3
@chrisdickinson
chrisdickinson / smooth_sortable_animating.html
Created January 29, 2011 05:39
smoothly animate jquery sortable lists.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
ul { float:left; margin-right:20px; }
body { color:white; font-family:Helvetica, sans-serif; text-shadow:1px 1px 1px rgba(0,0,0,0.2); }
ul { width:512px; overflow:hidden; border-radius:6px; }

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables