$ pip install click requests
$ python query_export.py --redash-url "https://app.redash.io/" --api-key ""
| import pymysql | |
| def execute(c, command): | |
| c.execute(command) | |
| return c.fetchall() | |
| db = pymysql.connect(host='localhost', port=3306, user='root', passwd='', db='mysql') #, charset='utf8') | |
| c = db.cursor() |
| #!/bin/bash | |
| # | |
| # Usage: | |
| # | |
| # 1. Set SECURITY_GROUP and KEY_NAME to your value | |
| # 2. source ec2-ping-test.sh | |
| # 3. launch_all_instances | |
| # 4. terminate_all_instances | |
| # |
| def multireplace(string, replacements, ignore_case=False): | |
| """ | |
| Given a string and a replacement map, it returns the replaced string. | |
| :param str string: string to execute replacements on | |
| :param dict replacements: replacement dictionary {value to find: value to replace} | |
| :param bool ignore_case: whether the match should be case insensitive | |
| :rtype: str | |
| """ |
| name | gender | race | |
|---|---|---|---|
| barjraj | m | indian | |
| ramdin verma | m | indian | |
| sharat chandran | m | indian | |
| birender mandal | m | indian | |
| amit | m | indian | |
| kushal | m | indian | |
| kasid | m | indian | |
| shiv prakash | m | indian | |
| vikram singh | m | indian |
| .d3-slider { | |
| position: relative; | |
| font-family: Verdana,Arial,sans-serif; | |
| font-size: 1.1em; | |
| border: 1px solid #aaaaaa; | |
| z-index: 2; | |
| } | |
| .d3-slider-horizontal { | |
| height: .8em; |
| #!/bin/bash | |
| TABLE_NAME=$1 | |
| # Get id list | |
| aws dynamodb scan --table-name $TABLE_NAME | grep ID | awk '{ print $2 }' > /tmp/truncate.list | |
| # Delete from id list | |
| cat /tmp/truncate.list | xargs -IID aws dynamodb delete-item --table-name $TABLE_NAME --key '{ "id": { "S": "ID" }}' |
| (function($){ | |
| var convertTableToJson = function() | |
| { | |
| var rows = []; | |
| $('table tr').each(function(i, n){ | |
| var $row = $(n); | |
| rows.push({ | |
| display_name: $row.find('td:eq(0)').text(), | |
| first_name: $row.find('td:eq(1)').text(), | |
| last_name: $row.find('td:eq(2)').text(), |
| curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' |
| // Create our server | |
| var server; | |
| server = http.createServer(function(req,res){ | |
| // Set CORS headers | |
| res.setHeader('Access-Control-Allow-Origin', '*'); | |
| res.setHeader('Access-Control-Request-Method', '*'); | |
| res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET'); | |
| res.setHeader('Access-Control-Allow-Headers', '*'); | |
| if ( req.method === 'OPTIONS' ) { | |
| res.writeHead(200); |