Skip to content

Instantly share code, notes, and snippets.

View trak3r's full-sized avatar

Thomas "Ted" Davis trak3r

View GitHub Profile

Before Chrome makes a cross-domain AJAX call it makes an OPTIONS check like this:

curl \
'https://fubar.com/users/sign_in' \
-X OPTIONS \
-H 'Access-Control-Request-Method: POST' \
-H 'Origin: http://snafu.com' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36' \
-H 'Access-Control-Request-Headers: content-type' \
The old prototype machine had our AWS API access key and secret key. Once the
hacker gained access to the keys, he created an IAM user, and generated a
key-pair. He was then able to run an instance inside our AWS account using
these credentials, and mount one of our backup disks. This backup was of one of
our component services, used for production environment, and contained a config
file with our database password. He also whitelisted his IP on our database
security group, which is the AWS firewall.
This is what i see in my unite buffer:
28 a app/assets/javascripts/backbone/comp..ews.js.coffee [coffee] (2014/06/09 16:10:54)
27 %a app/assets/javascripts/backbone/comp..ler.js.coffee [coffee] (2014/06/09 16:57:00)
The file names are so grossly truncated as to be useless.
1. Can I truncate the path prefixes instead of the file names? If so, how?
2. Can I kill the file type and time stamp columns? If so, how?
call unite#filters#matcher_default#use(['matcher_fuzzy'])
call unite#custom#source('buffer,file,file_rec/git','sorters', 'sorter_selecta')
nnoremap <leader>t :<C-u>Unite -no-split -buffer-name=files -profile-name=buffer -start-insert file_rec/git<CR>
call unite#custom#profile('buffer', 'ignorecase', 1)
this is a test of gist from vim.
this gist was edited by a fresh vim copy.
@trak3r
trak3r / README.md
Created April 24, 2013 12:37 — forked from reinh/README.md

Syntax highlight SQL inside Ruby <<-SQL heredocs

Embeds SQL syntax highlighting inside Ruby heredocs labeled SQL. This will also work to embed other syntaxen, e.g., HTML.

Optional PGSQL enhanced syntax:

(requires https://github.com/exu/pgsql.vim)

 syntax include @SQL syntax/pgsql.vim
root = exports ? this
root.TedTabs ?= {}
TedTabs.activateFirstNestedTabRecursively = (href, depth = 1) ->
if wrapper = $(document).find(href)
#
# activate the first nested tab link
#
if firstTab = wrapper.find("a[data-toggle=\"tab\"]").first()
firstTab.tab "show"
require "net/http"
# Example Usage:
#
# use Rack::Proxy do |req|
# if req.path =~ %r{^/remote/service.php$}
# URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}")
# end
# end
#
this works:
%script= raw render 'show.js.coffee'
but it throws this warning:
DEPRECATION WARNING: Passing the format in the template name is deprecated. Please pass render with :formats => [:js] instead.
--
#!/bin/bash
MINUTES=10
#
# this script pulls the last $MINUTES minutes out of the apache logs
# so cron it to run every $MINUTES minutes
#
SERVER_ALIAS=$(hostname -s)
NAMESPACE="Apache"
METRIC_NAME="RequestsPerMinute"