Skip to content

Instantly share code, notes, and snippets.

View funkatron's full-sized avatar

Ed Finkler funkatron

View GitHub Profile
@funkatron
funkatron / save_bash_history_example.bash
Created July 3, 2022 14:09
Save bash history after every command
# so you probably want to make this the last line of your .bash_profile, or something similar
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'history -a'
@funkatron
funkatron / vuejs-load-ajax-template.js
Created December 6, 2018 22:28
Simple JS function to dynamically load an HTML template for a VueJS component via AJAX
/**
* Registers a Vue component. Can take a `templateUrl` in the componentDef that is loaded and resolved to `template`
* @param {string} name
* @param {Object} componentDef
*/
function registerVueComponent(name, componentDef) {
if (componentDef.templateUrl) {
Vue.component(name, function (resolve, reject) {
// retrieve the template via axios async call
axios.get(componentDef.templateUrl)
@funkatron
funkatron / neo4j-auth-error-curl.bash
Created March 27, 2017 20:57
Connecting to Neo4j - authentication error
> curl https://HOSTNAME:7473/db/data/
{
"errors" : [ {
"code" : "Neo.ClientError.Security.Unauthorized",
"message" : "No authentication header supplied."
} ]
}
@funkatron
funkatron / gremlin-server.yaml
Created January 20, 2017 18:07
shell script and config files to run JanusGraph using BerkeleyDB and ElasticSearch as backend
# put this in the conf/gremlin-server/ directory
host: localhost
port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
serializedResponseTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
@funkatron
funkatron / Open in iTerm.scpt
Last active February 2, 2016 16:55
Open current Finder directory in iTerm
(*
* Finder Open iTerm Here - v1.0.2 - 4/14/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*
* Modified by Ed Finkler to work with iTerm 2.9x Beta - Tuesday; February 2, 2016
*)
<div id="invite-friends-component">
<div class="row">
<div class="col-md-8"><h3>Invite Friends</h3></div>
<div class="col-sm-4 col-xs-6">
<button class="btn btn-social btn-facebook btn-block"><i class="fa fa-facebook"></i>Insert contact using Facebook</button>
</div>
</div>
<div class="row">
<div class="col-md-12">
<form action="{{ inviteFriendsActionUrl }}" method="POST">
@funkatron
funkatron / gist:6809c147256601b283a5
Last active August 29, 2015 14:22
PHP step debugging outside the browser using XDebug, PHPStorm, the PHP dev server and httpie

Stuff I did to debug during API dev on my local machine

Run the PHP dev server on your given port

php -S 0.0.0.0:8080 -t public public/index.php

In httpie, pass ?XDEBUG_SESSION_START=foobar on the query string with the request

#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto
@funkatron
funkatron / fix_qcachegrind_homebrew.sh
Created September 28, 2014 22:12
Fix issue where qcachegrind cannot create call graphs
# from http://www.tekkie.ro/computer-setup/how-to-install-kcachegrind-qcachegrind-on-mac-osx/
sudo ln -s /usr/local/bin/dot /usr/bin/dot