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
{ | |
"device_parsers": [ | |
{ | |
"device_replacement": "HTC $1", | |
"regex": "HTC ([A-Z][a-z0-9]+) Build" | |
}, | |
{ | |
"device_replacement": "HTC $1", | |
"regex": "HTC ([A-Z][a-z0-9 ]+) \\d+\\.\\d+\\.\\d+\\.\\d+" | |
}, |
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/sh | |
# | |
# Script to run innobackupex script (for all databases on server), check for success, and apply logs to backups. | |
# | |
# (C)2010 Owen Carter @ Mirabeau BV | |
# This script is provided as-is; no liability can be accepted for use. | |
# You are free to modify and reproduce so long as this attribution is preserved. | |
# | |
INNOBACKUPEX=innobackupex-1.5.1 |
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
// From http://www.phpied.com/non-onload-blocking-async-js/ | |
(function(url){ | |
var iframe = document.createElement('iframe'); | |
(iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0"; | |
var where = document.getElementsByTagName('script'); | |
where = where[where.length - 1]; | |
where.parentNode.insertBefore(iframe, where); | |
var doc = iframe.contentWindow.document; | |
doc.open().write('<body onload="'+ |
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
<p> | |
<img src="http://imperavi.com/img/library.jpg" alt="" style="width: 300px; float: left; margin-top: 10px; margin-right: 15px; margin-bottom: 10px; "> | |
</p> | |
<h3>Fahrenheit 451</h3> | |
<p> | |
<span style="color: #a5a5a5;"><em>by Ray Bradbury</em></span> | |
</p> | |
<p> | |
He took hold of a straight-backed chair and moved it slowly and steadily into the hall near the front door and climbed up on it and stood for a moment like a statue on a pedestal, his wife standing under him, waiting. Then he reached up and pulled back the grill of the air-conditioning system and reached far back inside to the right and moved still another sliding sheet of metal and took out a book. Without looking at it he dropped it to the floor. He put his hand back up and took out two books and moved his hand down and dropped the two books to the floor. He kept moving his hand and dropping books, small ones, fairly large ones, yellow, red, green ones. When he was done he looked down upon some twenty books lying at his wife’s feet. | |
</p> |
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
from collections import defaultdict | |
from collections import Counter | |
emails = User.objects.values_list('email', flat=True) | |
domains = defaultdict(int) | |
for email in emails: | |
try: | |
domain = email.split('@')[1] | |
domains[domain] += 1 | |
except: |
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
{ | |
"token": "abc", | |
"user_email": "customer@stamps.co.id", | |
"store": 32, | |
"invoice_number": "abc123456", | |
"total_value": 50000, | |
"subtotal": 40000, | |
"discount": 0, | |
"service_charge": 5000, | |
"tax": 5000, |
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
curl https://stamps.co.id/api/memberships/suggestions.csv?token=830a2413ccccd3f82ec39f10f8cf5852ea518815\&query=king | |
Result: | |
"kingman@softwarerestoran.com,kingman2@softwarerestoran.com,king@asdf.com,kingman@abc.com,kingman@asdf.com" |
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
curl -X POST -H "Content-Type: application/json" https://stamps.co.id/api/transactions/add -i -d '{ "token": "830a2413ccccd3f82ec39f10f8cf5852ea518815", "user_email": "kingman@softwarerestoran.com", "store": 104, "invoice_number": "2", "total_value": 50000 }' | |
# On Windows, double quotes need to be escaped: | |
curl -k -X POST -H "Content-Type: application/json" https://stamps.co.id/api/transactions/add -i -d "{ \"token\": \"6ef480e7ac6d374f5e29fdd9abff8cbfbbb9a7ea\", \"user_email\": \"customer@stamps.co.id\", \"store\": 11, \"invoice_number\": \"invoice_2\", \"total_value\": 50000}" | |
curl -k -X POST -H "Content-Type: application/json" https://stamps.co.id/api/transactions/add -i -d "{ \"token\": \"6ef480e7ac6d374f5e29fdd9abff8cbfbbb9a7ea\", \"user_email\": \"customer@stamps.co.id\", \"store\": 11, \"invoice_number\": \"invoice_3\", \"total_value\": 50000, \"items\": [{\"product_name\": \"Cappucino\", \"quantity\": 2, \"price\": 10000}, {\"product_name\": \"Iced Tea\", \"quantity\": 4, \"price\": 5000}]}" |
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
./runtests.py --settings=test_sqlite get_earliest_or_latest |
NewerOlder