View surround_quotes.sql
SELECT CONCAT('"', email, '"') FROM email_list;
View locale.js
function browserLocale() {
var lang;
if (navigator.languages && navigator.languages.length) {
// latest versions of Chrome and Firefox set this correctly
lang = navigator.languages[0]
} else if (navigator.userLanguage) {
// IE only
lang = navigator.userLanguage
} else {
View vwap.go
package main
import (
"fmt"
)
func main() {
// [[volume, price], ...]
positions := [][]float64{
[]float64{2.5, 268},
View mfa_verify.js
import otplib from 'otplib'
export default function verify (mfaSecret, mfaCode) {
mfaCode = (mfaCode||'').replace(/[^\d]+/gi, '')
return otplib.authenticator.verify({
secret: mfaSecret,
token: mfaCode
})
View recaptcha_verify.js
import request from 'request'
export async function verify(captchaResponse) {
return new Promise((resolve, reject) => {
request.post('https://www.google.com/recaptcha/api/siteverify', {
form: {
secret: process.env.RECAPTCHA_SECRET_KEY,
response: captchaResponse,
}
}, (err, resp, body) => {
View twilio_send.js
const twilio = require('twilio')
// Twilio Credentials
const accountSid = 'abc123';
const authToken = 'abc123';
const client = new twilio(accountSid, authToken);
const fromNumber = '12225558888' // account phone number
export function normalizePhone(phone) {
View stars.txt
✢ ✥ ✦ ✧ ❂ ❉ ✱ ✲ ✴ ✵ ✶ ✷ ✸ ❇ ✹ ✺ ✻ ✼ ❈ ✮ ✡
★ ☆ ✩ ✫ ✬ ✭ ✮ ✯ ✰ ✪
View max_connections
LEAST({DBInstanceClassMemory/9531392},5000)
View redirect_https.js
<script>
var url = window.location.href.replace(/http:\/\/(?:www\.)?(mywebsite\.com|otherdomain\.io)/gi, 'https://mywebsite.com');
url !== window.location.href && (window.location.href = url)
</script>
View deregister_targets.js
const AWS = require('aws-sdk')
const elb = new AWS.ELBv2({apiVersion: '2015-12-01', region: 'us-east-1'})
async function getTGs(loadBalancerArn) {
return new Promise((resolve, reject) => {
elb.describeTargetGroups({}, (err, data) => {
if (err) return reject(err)
resolve(data.TargetGroups.map(x => x.TargetGroupArn))
})