Skip to content

Instantly share code, notes, and snippets.

🦄
hacking

Alexander Isora alexanderisora

🦄
hacking
Block or report user

Report or block alexanderisora

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View check.php
<?php
//Checks if user a Pro. If Pro send also his last/next payment info.
$checking_user_email = json_decode(file_get_contents('php://input'))->email;
$product_id = json_decode(file_get_contents('php://input'))->productID;
curl_init('https://vendors.paddle.com/api/2.0/subscription/users');
//https://paddle.com/docs/api-list-users/
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
View checkIfPro.js
checkIfPro(){
// Send email and PRO_PRODUCT_ID to check.php.
// check.php must get the list of all users from Paddle, then see if current user is among Pro users.
const userEmail = "email@example.com";
const PRODUCT_ID = 11111; //See this ID in the Paddle dashboard.
const URL = 'https://unicornplatform.com/api/check.php';
const data = {
email: userEmail,
productID: PRODUCT_ID
};
View initFirebaseAuth.js
import firebase from "firebase/app";
import 'firebase/auth';
import StyledFirebaseAuth from 'react-firebaseui/StyledFirebaseAuth';
initAuth(){
var config = {
apiKey: "<key>",
authDomain: "unicorn-platform-app.firebaseapp.com",
databaseURL: "https://unicorn-platform-app.firebaseio.com",
projectId: "unicorn-platform-app",
View initPaddle.js
initPaddle(){
//Init the Paddle after it's loaded from their server.
//There is no callback or an event so we use intervals to wait until it's loaded.
//We also must load their script from their servers to get the freshest code.
let interval = setInterval(() => {
if (typeof window.Paddle !== 'undefined') {
//Credentials: https://vendors.paddle.com/account
window.Paddle.Setup({
vendor: 11111,
@alexanderisora
alexanderisora / weird.js
Created Jul 27, 2018
Weird JS expressions
View weird.js
[] == ![] // -> true
Math.min() > Math.max() // -> true
a: b: c: d: e: f: g: 1, 2, 3, 4, 5; // -> 5
(1).__proto__.__proto__.__proto__ // -> null
(0.1 + 0.2) === 0.3 // -> false
//More funny code samples: https://github.com/denysdovhan/wtfjs
You can’t perform that action at this time.