Skip to content

Instantly share code, notes, and snippets.

@mcianni
mcianni / NSBezierPath+Length.h
Last active November 21, 2015 04:34
Category on NSBezierPath to approximate the length of a curve
//
// NSBezierPath+Length.h
//
// Created by mcianni on 10/14/12.
//
#import <Cocoa/Cocoa.h>
@interface NSBezierPath (Length)
- (double)length;
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'
#default screens
screen -t shell1 0
screen -t shell2 1
screen -t shell3 2
screen -t shell4 3
@celso
celso / init.vim
Last active March 8, 2024 18:31
Neovim setup for OSX users
syntax on
set ruler " Show the line and column numbers of the cursor.
set formatoptions+=o " Continue comment marker in new lines.
set textwidth=0 " Hard-wrap long lines as you type them.
set modeline " Enable modeline.
set esckeys " Cursor keys in insert mode.
set linespace=0 " Set line-spacing to minimum.
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
" More natural splits
set splitbelow " Horizontal split below current.
@odlp
odlp / update.sh
Last active May 3, 2020 10:06
Rbenv update Rubygems
#!/usr/bin/env sh
# Multiple vulnerabilities have been disclosed in RubyGems:
# https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/
#
# And again in March 2019:
# https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html
#
# If you're an Rbenv user, here's any easy one-liner to upgrade to a
# safe version of Rubygems (2.7.8 / 3.0.3 or later) for each installed Ruby version:
@shivasurya
shivasurya / template-creator.js
Created May 28, 2020 04:44
AWS SES Email Template Create/Update Script Wrapper
// install those dependencies first
var minify = require("html-minifier").minify;
var fs = require("fs");
var AWS = require("aws-sdk");
// usage : node .\template-creater.js .\emailtemplate.html emailtemplate.json false emailtemplate-unique-name "Subject for the email"
// 1st Argument => Templated HTML File
// 2nd Argument => Name of the generated template json file
// 3rd Argument => Update or Create template ( boolean )
// 4th Argument => Unique template name
@mkornatz
mkornatz / datahub-nginx-proxy.conf
Last active February 2, 2022 16:57
DataHub nginx proxy configuration (supports websockets)
# This configuration can be used to create a reverse proxy for use with Figment's DataHub service
#
# This file can be included by placing it into /etc/nginx/sites-enabled/ (Debian based distros)
# or /etc/nginx/conf.d/ (Red Hat based distros)
server {
# The proxy will listen on port 80 (SSL is not enabled)
listen 80;
# Replace EXAMPLE with the DataHub service name