POST /photo/mApp/ajax/login.php HTTP/1.1
Content-Length: 113
Content-Type: application/x-www-form-urlencoded
Host: 192.168.1.2:80
Connection: Keep-Alive
action=login&username=user&passwd=password&video_formats=%5B%5B%22*%22%2C0%2C0%2C1280%2C720%2C0%2C%5B%5D%5D%5D
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
### | |
This gist illustrates how to create and execute a payment with Paypal using their REST API. | |
For additional informations, check the documentation: https://developer.paypal.com/docs/api/ | |
Note 1: I assume that you have already created a developer account for Paypal and an application. | |
To test that your code is working, use the sandbox accounts. | |
https://developer.paypal.com/webapps/developer/applications/accounts | |
Note 2: we will not use the Paypal REST API SDK package for Node.js | |
https://github.com/paypal/rest-api-sdk-nodejs |
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
Template.Calendar.onCreated(function () { | |
const instance = this; | |
instance.viewDate = new ReactiveVar(); | |
instance.autorun(() => { | |
const viewDate = instance.viewDate.get(); | |
if (typeof viewDate !== 'undefined') { | |
const startDate = Math.round(viewDate.start / 1000); |
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
Perl and PHP Regular Expressions | |
PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. Here are some commonly needed regular expressions for both PHP and Perl. Each regex will be in string format and will include delimiters. | |
All Major Credit Cards | |
This regular expression will validate all major credit cards: American Express (Amex), Discover, Mastercard, and Visa. | |
//All major credit cards regex | |
'/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|622((12[6-9]|1[3-9][0-9])|([2-8][0-9][0-9])|(9(([0-1][0-9])|(2[0-5]))))[0-9]{10}|64[4-9][0-9]{13}|65[0-9]{14}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})*$/' |
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
var AWS = require('aws-sdk'); | |
AWS.config.update({ | |
accessKeyId: '{AWS_KEY}', | |
secretAccessKey: '{AWS_SECRET}', | |
region: '{SNS_REGION}' | |
}); | |
var sns = new AWS.SNS(); |
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 React, { ReactChild } from 'react'; | |
import { Database } from '@nozbe/watermelondb'; | |
import { getWatermelon } from 'app/utils/DBWatermelonOld/DBWatermelonOld'; | |
import DatabaseProvider from '@nozbe/watermelondb/DatabaseProvider'; | |
const WatermelonProvider = (props) => { | |
const watermelonRef = React.useRef(); | |
const [database, setDatabase] = React.useState(); | |
if (!watermelonRef.current) { |