Skip to content

Instantly share code, notes, and snippets.

@sansmischevia
sansmischevia / nginx.conf
Last active June 3, 2024 22:56
nginx http proxy to s3 static websites
##
## This nginx.conf servers as the main config file for webflow reverse proxy
##
## RCS:
## https://gist.github.com/sansmischevia/5617402
##
## Hardening tips:
## http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html
##
@dankrause
dankrause / _hover_example.py
Last active February 25, 2026 03:07
Example code to use the (unofficial, unsupported, undocumented) hover.com DNS API.
import requests
class HoverException(Exception):
pass
class HoverAPI(object):
def __init__(self, username, password):
params = {"username": username, "password": password}
r = requests.post("https://www.hover.com/api/login", params=params)

The OAuth Dance with FreshBooks

Terminology

  • User - The FreshBooks account, whose information we are trying to access via OAuth
  • Consumer - The FreshBooks account, who we authorize to access the user's information
  • Consumer key - The consumer's subdomain, consumer_key.freshbooks.com
  • Consumer Secret - The consumer's secret, that we will use to make OAuth requests.
  • Request Token - A value used by the consumer to obtain authorization and an access token from the user.
  • Access Token - A value used by the consumer to access the user's information.
  • Access Token Secret - A secret used by the consumer to establish ownership of a given Token.
@Chrisedmo
Chrisedmo / SHOPIFY: Percentage Discount Saved
Created May 2, 2013 19:00
SHOPIFY: How To Show Percentage Discount Saved
{% comment %}How To Show Percentage Discount Saved{% endcomment %}
{% if product.compare_at_price_max > product.price %}You save {{ product.compare_at_price_max | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_max | money_without_currency | times: 100 | remove: ‘.0′}}%{% endif %}
@blackfalcon
blackfalcon / basic_sass_features.md
Created April 29, 2013 07:05
Exercises in basic Sass features

Sass is a powerhouse language that is adding new features all the time. For this introduction we will go over the basics of the language and see how they all tie together. We will discuss nesting, parent selector definitions, variables, Sass math, @extends, and @mixins.

Code comments

Commenting your code is the number one awesome thing any developer can do. In CSS you can place comments in your code /* */, but this will appear in the actual CSS and sometimes you don't want or need all that stuff to be there.

In Sass comments are highly encouraged. Sass has what are called 'silent comments' using the // syntax. This will allow the developer to comment like crazy and none of this is exposed in the final CSS. An interesting feature is that Sass supports both types of comments.

Scss

@thomasmb
thomasmb / statusboard-serverstats.php
Created April 10, 2013 14:05
A simple script for getting and displaying server stats in StatusBoard
<?php
//add your server aliases here
$servers = array(
"185.14.184.234" => "mcfly.bensmann.no",
"185.14.184.xxx" => "another.server.com",
);
//this script is triggered by this command from the terminal or cron:
//echo "time=`uptime`&df=`df -h`" | curl -s -d @- http://domain.com/path/to/script.php
@kotnik
kotnik / pastebin.sh
Created April 8, 2013 14:49
Self-hosted pastebin. Pipe code/text to be automatically uploaded to your server for sharing.
#!/bin/bash
USER=YOUR_USERNAME
HOST=YOUR_SERVER_HOSTNAME
WEBPATH=PATH_TO_WEBSERVER_ROOT
WEBURL=YOUR_URL
BACKUP_DIR=DIR_FOR_BACKUP
file=$(mktemp $BACKUP_DIR/XXXXXX)
mv $file $file.html
@jpawlowski
jpawlowski / brew-sync.sh
Last active January 6, 2026 22:36
Sync Homebrew installations between Macs via Dropbox
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
@HTMLToronto
HTMLToronto / WebRTC Minimal Example
Created February 25, 2013 01:32
WebRTC minimal example for you to start playing with. Post your results back to @HTML5_Toronto and show off your skills. Remember, if you’re using Firefox, the current version requires you to activate the media.peerconnection.enabled within the about:config setting.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<video></video>
<script>
window.addEventListener('DOMContentLoaded', function() {
'use strict';
@murtaugh
murtaugh / 1. single-line.html
Last active November 20, 2025 21:49
Blockquote patterns for ALA
<figure class="quote">
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote>
</figure>