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
-- show slow queries eating whole CPU | |
SELECT substring(query, 1, 50) AS short_query, round(total_time::numeric, 2) AS total_time, calls, rows, round(total_time::numeric / calls, 2) AS avg_time, round((100 * total_time / sum(total_time::numeric) OVER ())::numeric, 2) AS percentage_cpu FROM pg_stat_statements ORDER BY total_time DESC LIMIT 20; | |
-- same as above but whole query | |
SELECT query AS short_query, round(total_time::numeric, 2) AS total_time, calls, rows, round(total_time::numeric / calls, 2) AS avg_time, round((100 * total_time / sum(total_time::numeric) OVER ())::numeric, 2) AS percentage_cpu FROM pg_stat_statements ORDER BY total_time DESC LIMIT 20; |
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
<body> | |
<h1 class="title" sheetsu-key="Header"> | |
DrivePages by Sheetsu - simplest solution to host websites | |
</h1> | |
<h2 class="subtitle"> | |
<a href="https://sheetsu.com/pages" sheetsu-key="Main link"> | |
Visit pages.sheetsu.com | |
</a> | |
</h2> |
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
<a href="#" onclick='Intercom("showNewMessage", "Hello there! 👋 I want to add domain to my Sheetsu Page")'>Add Domain</a> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<script src="//script.sheetsu.com/"></script> | |
</head> | |
<body> | |
<script> | |
function getParamsFromUrl(url) { |
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
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
</head> | |
<body> | |
<form id="form"> | |
<input type="text" name="name"> | |
<input type="text" name="score"> | |
<button type="submit">submit</button> |
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
angular.module('app').service('Subjucator', [ | |
'$http', function($http) { | |
return { | |
get: function(url) { | |
return $http.get(url); | |
}, | |
post: function(url, data) { | |
return $http.post(url, data); | |
} | |
}; |
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
module SheetCRUD | |
module Error | |
ERRORS = [ | |
unauthorized: { message: 'Unauthorized.', status: 401 }, | |
limit_exceed: { message: 'Rate limit exceed.', status: 429 }, | |
not_found: { message: 'Not found.', status: 404 } | |
] | |
class StandardAPIError < StandardError |
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 requests | |
url = 'https://sheetsu.com/apis/YOUR_API_ID' | |
data = {"timestamp": "1458819671995", "idea": "wooho"} | |
r = requests.post(url, json=data) | |
print r.status_code | |
print r.json() |
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
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-3.0.0-alpha1.js"></script> | |
</head> | |
<body> | |
<ul id="characters-list"></ul> | |
<script> | |
var sheetsuUrl = "https://sheetsu.com/apis/v1.0/020b2c0f"; |
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
require 'pry' | |
require 'json' | |
require 'httparty' | |
require 'stripe' | |
class ChargeApp < Sinatra::Base | |
AMOUNT = 300 | |
Stripe.api_key = "SECRET_STRIPE_KEY" |
NewerOlder