This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function evenRound(num, decimalPlaces) { | |
var d = decimalPlaces || 0; | |
var m = Math.pow(10, d); | |
var n = +(d ? num * m : num).toFixed(8); // Avoid rounding errors | |
var i = Math.floor(n), f = n - i; | |
var e = 1e-8; // Allow for rounding errors in f | |
var r = (f > 0.5 - e && f < 0.5 + e) ? | |
((i % 2 == 0) ? i : i + 1) : Math.round(n); | |
return d ? r / m : r; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
/* Fixes Home/End keys for OSX */ | |
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol" } }, | |
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol" } }, | |
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } }, | |
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true } }, | |
{ "keys": ["super+home"], "command": "move_to", "args": {"to": "bof" } }, | |
{ "keys": ["super+end"], "command": "move_to", "args": {"to": "eof" } }, | |
{ "keys": ["super+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true } }, | |
{ "keys": ["super+shift+end"], "command": "move_to", "args": {"to": "eof", "extend": true } }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to backup git repo to S3 | |
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars | |
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc | |
bucket=$GITHUB_BACKUP_BUCKET | |
dir=$GITHUB_BACKUP_DIR | |
password=$GITHUB_BACKUP_PASSWORD | |
account=$GITHUB_ACCOUNT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Pavan Kumar Sunkara | |
email = [email protected] | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[sendemail] | |
smtpencryption = tls | |
smtpserver = smtp.gmail.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git grep -lz 'AAA' | xargs -0 perl -i'' -pE "s/AAA/BBB/g" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[core] | |
editor = nano | |
[interactive] | |
singleKey = true | |
[push] | |
default = simple | |
[color] | |
ui = true | |
[alias] | |
#### Generic #### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reloadCSS() { | |
const links = document.getElementsByTagName('link'); | |
Array.from(links) | |
.filter(link => link.rel.toLowerCase() === 'stylesheet' && link.href) | |
.forEach(link => { | |
const url = new URL(link.href, location.href); | |
url.searchParams.set('forceReload', Date.now()); | |
link.href = url.href; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class LaravelConditionalIndexMigration extends Migration | |
{ | |
/** | |
* Run the migrations. |
OlderNewer