Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / config.json
Created March 28, 2016 02:46
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#3E4862",
"@brand-success": "#5cb85c",
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@pixelbacon
pixelbacon / squarespaceBreakpoints.less
Last active January 24, 2024 09:32
Squarespace Breakpoints.
/**
Squarespace essentially doesn't really document their breakpoints.
This can be quite annoying to not have when doing custom CSS.
Most themes use essentially one breakpoint. Mobile and not mobile; anything 750 and below is considered mobile.
You can use these to write your own CSS and simply use the "Style Editor" to inject your compiled CSS in the event
you are not using "Developer Mode" in your site.
Enjoy!
@Razoxane
Razoxane / reverse_anti-join.sql
Last active July 29, 2016 05:00
Preferred way to suppress reversed journal entries
SELECT je.*
FROM journal_entry AS je ON a.assetID = je.assetID
AND je.reference IN ('OPEN','AQ','DR')
AND CASE WHEN je.reference = 'DR' THEN je.description LIKE 'Direct Reinvestment%' ELSE 1=1 END
AND je.entryType = 'debit'
AND IFNULL(je.assetID,0) > 0
/* some join conditions for the je table, can vary depending on what's being joined (account or asset) */
LEFT JOIN journal_entry AS aj ON je.fundID = aj.fundID
AND je.memberAccountID = aj.memberAccountID
@jczaplew
jczaplew / pgFormatDate.js
Created April 24, 2015 14:11
Javascript Date to Postgres-acceptable format
// Convert Javascript date to Pg YYYY MM DD HH MI SS
function pgFormatDate(date) {
/* Via http://stackoverflow.com/questions/3605214/javascript-add-leading-zeroes-to-date */
function zeroPad(d) {
return ("0" + d).slice(-2)
}
var parsed = new Date(date)
@endel
endel / getMoonPhase.js
Created March 25, 2015 16:04
Get Moon Phase by Date, written in JavaScript
/*
* modified from http://www.voidware.com/moon_phase.htm
*/
function getMoonPhase(year, month, day)
{
var c = e = jd = b = 0;
if (month < 3) {
year--;
@davidblewett
davidblewett / lp-ssh-add.sh
Last active December 12, 2021 11:12
Allow storage of SSH private keys in LastPass, and use lpass CLI to retrieve and load into ssh-agent. The general idea is to store the private key armored ASCII in an "SSH Key" Secure Note, in a specific folder (i.e.: "Secure Notes\SSH" ).
#!/bin/sh
#
# Import all SSH keys from LP
#
PREFIX=~
SSH_ASKPASS=$PREFIX/bin/lp-askpass.sh
export SSH_ASKPASS
# This is needed to force ssh-add to honor our SSH_ASKPASS.
DISPLAY=foo
export DISPLAY
@chrisblakley
chrisblakley / server-side-ga-events.php
Last active August 16, 2022 19:22
PHP functions to send data to Google Analytics
//Parse the GA Cookie
function gaParseCookie() {
if (isset($_COOKIE['_ga'])) {
list($version, $domainDepth, $cid1, $cid2) = explode('.', $_COOKIE["_ga"], 4);
$contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1 . '.' . $cid2);
$cid = $contents['cid'];
} else {
$cid = gaGenerateUUID();
}
return $cid;
@jloveland
jloveland / rename-tag
Created October 5, 2014 02:48
rename a git tag
#!/bin/bash
echo "enter new tag: "
read new
echo "enter old tag: "
read old
echo "new tag: " $new
echo "old tag: " $old
@jonathantneal
jonathantneal / README.md
Last active March 19, 2024 23:31
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"