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
/usr/bin/sshpass -p mypass ssh myuser@myhost1.com -o UserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no 'tar zcf - ./scratch/in' | \ | |
/usr/bin/sshpass -p mypass ssh myuser@myhost2.com -o UserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no 'tar xzf - -C ./scratch/out' |
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
/* | |
Copyright (c) 2015 My Name <opensource@domain.com> | |
Permission is hereby granted, free of charge, to any person | |
obtaining a copy of this software and associated documentation | |
files (the |
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
import logging | |
import traceback as tb | |
import suds.metrics as metrics | |
from suds import WebFault | |
from suds.client import Client | |
errors = 0 | |
logging.getLogger('suds.client').setLevel(logging.DEBUG) |
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
Workaround to issue with CMD.exe inside emacs not prompting for password when "git push" command is issued. | |
1. download and run git-credential-winstore.exe - https://gitcredentialstore.codeplex.com | |
2. add this to the .gitconfig in C:\Users\<youruser> - http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows | |
[credential] | |
helper = "winstore" | |
Now when inside emacs, do M-x, shell. | |
Try pushing through https to github, you'll get a graphical login that allows you to input user/pass. |
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
You can get help for a command by typing | |
C-h f function-name | |
This will usually tell you if it has a standard key binding. Conversely, given a key sequence, you can type | |
C-h k key-sequence | |
To get the command that would run. For more help on getting help, you can type |
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
Active undoo-tree with C-x u | |
Move up,down,left, and right the tree with up/down/left/right arrow | |
In the tree window you can enable timestamps and diffs with t and d | |
;; t (`undo-tree-visualizer-toggle-timestamps') | |
;; Toggle display of time-stamps. | |
;; | |
;; d (`undo-tree-visualizer-toggle-diff') |
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 'ring.adapter.jetty) | |
(defn app-handler [request] | |
{:status 200 | |
:headers {"Content-Type" "text/html"} | |
:body (str request)}) | |
(defonce server (run-jetty #'app-handler {:port 3000 :join? false})) | |
(.start server) |
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 | |
DAYS_AGO=$1 | |
TARGET_INDEX=logstash-`date --date="$DAYS_AGO days ago" +%Y.%m.%d`; | |
if [[ "$DAYS_AGO" ]]; then | |
# echo "computed target index: $TARGET_INDEX" | |
curl -XDELETE "http://localhost:9200/$TARGET_INDEX" | |
else |
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
brew install -v emacs --HEAD --use-git-head --with-cocoa --srgb |