Skip to content

Instantly share code, notes, and snippets.

View aziz's full-sized avatar

Allen Bargi aziz

  • Gothenburg, Sweden
View GitHub Profile
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@aslakknutsen
aslakknutsen / Asciidoctor.py
Last active December 16, 2015 04:19
Sublime AsciiDoctor Plugin
import re
import sublime
import sublime_plugin
import webbrowser
REG_RENAME = re.compile("\.(asciidoc|adoc|asc|ad)$")
EXT = re.compile(".*\.(asciidoc|adoc|asc|ad)$")
COMMAND = "asciidoctor -b html5"
@alehandrof
alehandrof / subl-scopes
Last active November 23, 2023 20:09
scopes for sublime text schemes
comment
comment punctuation
comment.block.documentation
comment.block.preprocessor
comment.documentation
constant
constant.character
constant.character punctuation
constant.character.entity
constant.character.escape
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
function whichTransitionEvent(){
var t;
var el = document.createElement('fakeelement');
var transitions = {
'transition':'transitionend',
'MSTransition':'msTransitionEnd',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
}
@brysongilbert
brysongilbert / css-gradient-mixin.less
Created October 15, 2012 20:35
LESS Mixin for CSS/SVG Vertical Gradients
// Vertical gradient using CSS where possible, and base64-encoded SVG for IE9 (enables use of this in combination with border-radius)
// Based on this by Phil Brown: http://blog.philipbrown.id.au/2012/09/base64-encoded-svg-gradient-backgrounds-in-less/
// Also based on a mixin from Twitter Bootstrap: https://github.com/twitter/bootstrap
.gradient-vertical(@startColor, @endColor) {
// IE9 prep
@dataPrefix: ~"url(data:image/svg+xml;base64,";
@dataSuffix: ~")";
@dataContent: ~'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><linearGradient id="g743" gradientUnits="userSpaceOnUse" x1="0%" y1="0%" x2="0%" y2="100%"><stop stop-color="@{startColor}" offset="0"/><stop stop-color="@{endColor}" offset="1"/></linearGradient><rect x="0" y="0" width="1" height="1" fill="url(#g743)"/></svg>';
@brysongilbert
brysongilbert / css-shadow-mixin.less
Created October 15, 2012 01:48
LESS Mixin for CSS/SVG Filter Drop Shadows
// Drop shadow using SVG/CSS filters were possible
// Requires Modernizr and the css-filters and svg-filters community add-ons
.filter-shadow(@x, @y, @size, @color) {
// Firefox 10+
.svgfilters & {
@svgSize: @size/2; // the SVG blur is a little larger than the CSS equivalent
filter: url('data:image/svg+xml;utf8,<svg%20height="100"%20xmlns="http://www.w3.org/2000/svg"><filter%20id="drop-shadow"><feGaussianBlur%20in="SourceAlpha"%20stdDeviation="@{svgSize}"/><feOffset%20dx="@{x}"%20dy="@{y}"%20result="offsetblur"/><feFlood%20flood-color="@{color}"/><feComposite%20in2="offsetblur"%20operator="in"/><feMerge><feMergeNode/><feMergeNode%20in="SourceGraphic"/></feMerge></filter></svg>#drop-shadow');
}
// Chrome 19+, Safari 6+
(function($) {
function parseImagesFromCSS(doc) {
var i, j,
rule,
image,
pattern = /url\((.*)\)/,
properties = ['background-image', '-webkit-border-image'],
images = {};
if (doc.styleSheets) {
@randylubin
randylubin / proxyServer
Created July 1, 2012 19:02
Node.js Multi-App Proxy Server with Forwarding
var http = require('http'),
httpProxy = require('http-proxy');
//
// Setup proxy server with forwarding
//
var options = {
router: {
'proxytest.randylubin.com': '127.0.0.1:7200',
'randylubin.com': '127.0.0.1:7200',