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
var axios = require('axios'); // Add 'axios' to Dependencies at https://www.twilio.com/console/functions/configure | |
exports.handler = function (context, event, callback) { | |
delete context[AUTH_TOKEN]; | |
axios | |
.post( | |
'https://webhooks.direqt.io/twilio', | |
{ context, event }, | |
{ params: { apiKey: context.DIREQT_API_KEY || event.DIREQT_API_KEY } } | |
) | |
.then(function (response) { |
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
componentDidUpdate(_: *, prevState: PlayActionState) { | |
const diff = Object.keys(this.state).reduce((d, key) => { | |
if (prevState[key] === this.state[key]) return d; | |
return { | |
...d, | |
[key]: this.state[key], | |
}; | |
}, {}); | |
console.log(diff); | |
} |
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
import thing | |
import pytest | |
import requests_mock as rm_module | |
@pytest.fixture | |
def requests_mock(request): | |
with rm_module.Mocker() as m: | |
yield m |
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
<!doctype html> | |
<html> | |
<head> | |
<script type="text/javascript" a | |
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js"></script> | |
<style type="text/css"> | |
.dropTarget { | |
width: 300px; | |
height: 100px; | |
border: 1px solid green; |
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
select trim(pgdb.datname) as Database, | |
trim(a.name) as Table, ((b.mbytes/part.total::decimal)*100)::decimal(5,2) as pct_of_total, b.mbytes, b.unsorted_mbytes | |
from stv_tbl_perm a | |
join pg_database as pgdb on pgdb.oid = a.db_id | |
join (select tbl, sum(decode(unsorted, 1, 1, 0)) as unsorted_mbytes, count(*) as mbytes | |
from stv_blocklist group by tbl) b on a.id=b.tbl | |
join ( select sum(capacity) as total | |
from stv_partitions where part_begin=0 ) as part on 1=1 | |
where a.slice=0 | |
order by 3 desc, db_id, name; |
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
import logging | |
from django.contrib.auth import get_user_model | |
from stormpath.api_auth import ApiRequestAuthenticator | |
import base64 | |
from stormpath.error import Error | |
from django_stormpath.backends import StormpathBackend | |
log = logging.getLogger(__name__) | |
def get_application(): |
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
/** | |
* Simple Expressjs application demonstrating difference in routing behavior | |
* between version 4.12.4 and 4.13.1. | |
*/ | |
var express = require('express'); | |
var request = require('request'); | |
var http_server = express() | |
.get('/:foo\\(:bar?\\)', function(req, res, next) { | |
res.end(JSON.stringify({ 'foo': req.params.foo, 'bar': req.params.bar })); | |
}).listen(8080, function() { |
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
BEGIN TRANSACTION; | |
TRUNCATE TABLE MultiListingCampaignMappings; | |
BULK INSERT MultiListingCampaignMappings | |
FROM 'c:\users\Administrator\multimappings.csv' | |
WITH | |
( | |
FIELDTERMINATOR = ',', --CSV field delimiter | |
ROWTERMINATOR = '\n' --Use to shift the control to next row |