Skip to content

Instantly share code, notes, and snippets.

View jarrettbarnett's full-sized avatar

Jarrett Barnett jarrettbarnett

  • Boston, MA
View GitHub Profile

Cursor's Memory Bank

I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

Memory Bank Structure

The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

flowchart TD
This problem is usually due to the map div not being rendered before the javascript runs that needs to access it. You should put your initialization code inside an onload function or at the bottom of your HTML file, just before the tag, so the DOM is completely rendered before it executes (note that the second option is more sensitive to invalid HTML). Note, as pointed out by matthewsheets this also could be cause by the div with that id not existing at all in your HTML (the pathological case of the div not being rendered) Adding code sample from wf9a5m75's post to put everything in one place: <script type="text/javascript"> function initialize() { var latlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); } google.maps.event.addDomListener(
#!/bin/bash
##
# Prevents CrashPlan from de-duplicating data on files greater than 1k.
# Based on information from http://networkrockstar.ca/2013/09/speeding-up-crashplan-backups/
#
# NOTE: Must be run with sudo! IE: $ sudo sh ./crashplanFixup
##
# This is the path to your my.service.xml file
FILEPATH='/Library/Application Support/CrashPlan/conf/my.service.xml'
var getBootstrapVersion = function () {
var deferred = $.Deferred();
var script = $('script[src*="bootstrap"]');
if (script.length == 0) {
return deferred.reject();
}
var src = script.attr('src');
$.get(src).done(function(response) {

Mac

git config --global core.excludesfile ~/.gitignore

Windows

git config --global core.excludesfile %USERPROFILE%\.gitignore

Starter .gitignore

Mac

@jarrettbarnett
jarrettbarnett / warmly.sh
Created July 26, 2017 19:45 — forked from thomasfr/warmly.sh
A wget based easy poor man`s cache warmer script
#!/bin/bash
# warmly.sh
# A wget based, easy, poor man`s cache warmer script
# https://gist.github.com/thomasfr/7926314
# The MIT License (MIT)
#
# Copyright (c) 2013,2014 Thomas Fritz <[email protected]> (http://fritzthomas.com)
#
@jarrettbarnett
jarrettbarnett / sphp.sh
Created July 17, 2017 23:48 — forked from w00fz/sphp.sh
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@jarrettbarnett
jarrettbarnett / crashplanFixup.sh
Created May 19, 2017 15:37 — forked from thewellington/crashplanFixup.sh
Prevent CrashPlan from de-duplicating data on a Mac. Improves transfer speed! #mac #blog #crashplan
#!/bin/bash
#
# crashplanFixup.sh for Macintosh OS X 10.9 (and probably earlier versions)
#
# This script will prevent CrashPlan from de-duplicating data on files greater than 1k.
# Based on information from http://networkrockstar.ca/2013/09/speeding-up-crashplan-backups/
#
# NOTE: Must be run with sudo! IE: $ sudo sh ./crashplanFixup
#
# v1.1 2014-03-13 by [email protected]
@jarrettbarnett
jarrettbarnett / vcl-regex-cheat-sheet
Created March 21, 2017 18:44 — forked from dimsemenov/vcl-regex-cheat-sheet
Regular expression cheat sheet for Varnish (.vcl). Examples of vcl regexp. Found here http://kly.no/varnish/regex.txt (by Kristian Lyngstøl)
Regular expression cheat sheet for Varnish
Varnish regular expressions are NOT case sensitive. Varnish uses POSIX
regular expressions, for a complete guide, see: "man 7 regex"
Basic matching:
req.url ~ "searchterm"
True if req.url contains "searchterm" anywhere.
req.url == "searchterm"
@jarrettbarnett
jarrettbarnett / Vagrant Ethernet Issue.md
Last active March 20, 2017 17:25
Resolves the following error: Bringing up interface eth2: Device eth2 does not seem to be present, delaying initialization. [FAILED]

Option 1

1. Update .Vagrantfile

You can edit Vagrantfile file in any standard text editor or via VIM:

$ cd /Web
$ vim Vagrantfile

Locate a line that starts with: