This file contains hidden or 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
| <% | |
| require 'cgi' | |
| require 'uri' | |
| def attribute(name, value, force_string = false) | |
| if value | |
| value_string = | |
| if force_string | |
| '"' + value + '"' | |
| else |
This file contains hidden or 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/env python | |
| # Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
| # Written by Nathan Hamiel (2010) | |
| from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
| from optparse import OptionParser | |
| class RequestHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): |
This file contains hidden or 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
| FOR ACTION SEND | |
| ⌘← "HEX CODE" 0x01 | |
| ⌘→ "HEX CODE" 0x05 | |
| ⌥← "SEND ESC SEQ" b | |
| ⌥→ "SEND ESC SEQ" f |
This file contains hidden or 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
| $http = angular.element(document.body).injector().get('$http') |
This file contains hidden or 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
| string_t = None | |
| def get_rstring(addr): | |
| s = addr.cast(string_t.pointer()) | |
| if s['basic']['flags'] & (1 << 13): | |
| return s['as']['heap']['ptr'].string() | |
| else: | |
| return s['as']['ary'].string() | |
| def get_lineno(iseq, pos): |
This file contains hidden or 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
| open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app |
This file contains hidden or 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
| # GET | |
| curl -v -H "Content-type: application/json" -H "Accept: application/json" -H "X-AUTH-TOKEN:123456" -X GET -d '{"q":"core"}' http://localhost:3000/search |
This file contains hidden or 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
| #redis://redistogo:d20739cffb0c0a6fff719acc2728c236@catfish.redistogo.com:9402 | |
| redis-cli -h catfish.redistogo.com -p 9402 -a d20739cffb0c0a6fff719acc2728c236 flushall |
This file contains hidden or 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
| HOST=localhost | |
| STORAGE_PATH=~/srv/docker/postgresql | |
| DUMP_FILE_PATH=/path/to/dump/file | |
| docker run --name postgresql-master -itd --restart always \ | |
| --publish 5433:5432 \ | |
| --volume $STORAGE_PATH/postgresql-master:/var/lib/postgresql \ | |
| --env 'PG_PASSWORD=passw0rd' \ | |
| --env 'DB_USER=dbuser' --env 'DB_PASS=dbuserpass' --env 'DB_NAME=dbname' \ | |
| --env 'REPLICATION_USER=repluser' --env 'REPLICATION_PASS=repluserpass' \ |
This file contains hidden or 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
| -- check the last time tables were vacuumed and analyzed | |
| -- Ref: https://lob.com/blog/supercharge-your-postgresql-performance/ | |
| SELECT relname, last_vacuum, last_autovacuum, last_analyze, last_autoanalyze | |
| FROM pg_stat_all_tables | |
| WHERE schemaname = 'public'; |