Skip to content

Instantly share code, notes, and snippets.

View aficiomaquinas's full-sized avatar

Víctor González aficiomaquinas

View GitHub Profile
@swaroopch
swaroopch / flask-boilerplate-tmux.bash
Created December 5, 2010 07:00
A command that scripts a tmux session
#!/bin/bash
function flask-boilerplate-tmux
{
# https://github.com/swaroopch/flask-boilerplate
BASE="$HOME/code/flask-boilerplate"
cd $BASE
tmux start-server
tmux new-session -d -s flaskboilerplate -n model
@millenomi
millenomi / gourl.sh
Created January 14, 2011 16:23
This is a wrapper around the 'curl' command-line tool that adds a few useful features.
#!/bin/bash
if [ "$#" == "0" ]; then
echo "usage: $0 [CURL FLAGS|--json FILE|--https|--dry-run]* URL" >&2
echo "You can set the BASE_URL environment variable; if you do, all relative URLs will be have the BASE_URL appended in front of them. (Note that this appends blindly the two strings together, doing no resolution work.)" >&2
exit 1
fi
args=("$@")
verbatim_args=()
@boucher
boucher / StripeTutorialPage.html
Created February 6, 2012 07:05
Stripe Tutorial Payment Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below
@simenbrekken
simenbrekken / README.md
Created March 8, 2012 06:39
Super simple Backbone + Express + MongoDB REST backend application

Requirements:

If you're on OSX you're probably best off using Homebrew to install this stuff:

$ brew install node mongodb

Usage:

@Siedrix
Siedrix / key.json
Created August 10, 2012 00:28
Key bindings Sublime text
[
{ "keys": ["ctrl+u", "ctrl+i"], "command": "insert_snippet", "args": {"contents": "console.log('$SELECTION',$SELECTION);"} },
{ "keys": ["ctrl+u", "ctrl+o"], "command": "insert", "args": {"characters": "console.log();"} },
{ "keys": ["ctrl+u", "ctrl+p"], "command": "insert", "args": {"characters": "debugger;"} }
]
@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@terkel
terkel / _decimal.scss
Last active June 17, 2024 14:07
Rounding decimals in Sass
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0
@JoostKiens
JoostKiens / compass-HiDPI-images.scss
Last active December 10, 2015 23:38
Cross-browser, slimmed-down Compass media query mixin for high-density images.
/**
* Author: @joostkiens
* Licensed under the MIT license
*/
@mixin hr-image($lr-image, $hr-image) {
background-image: url($lr-image);
@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(-o-min-device-pixel-ratio: 5/4),
(min-resolution: 120dpi) {
@JoostKiens
JoostKiens / blockquote-microdata.html
Last active February 6, 2017 17:50
HTML5 blockquote & citation in figure & figcaption with microdata
<!--
/**
* Author: @joostkiens
* Licensed under the MIT license
*/
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
@barneycarroll
barneycarroll / jquery.lipo.js
Last active March 23, 2019 23:38
Get rid of redundant whitespace & empty structural elements, in that order
void function semanticContentScope(context, jQuery){
var $ = context.jQuery || jQuery || false;
if(!$){
return false;
}
// Strips elements of duplicate, leading and trailing whitespace and removes empty non-functional elements recursively
function semanticContent(markup){
// Conversion