Skip to content

Instantly share code, notes, and snippets.

@bansicloud
bansicloud / api_autoresponder.php
Created March 16, 2023 08:15 — forked from T1mmyK0/api_autoresponder.php
Example of how to process AutoResponder requests with your web server 🤖 Add this php file to your web server and enter the complete URL in AutoResponder (e.g. https://www.example.com/api_autoresponder.php).
<?php
// required headers
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
// add this php file to your web server and enter the complete url in AutoResponder (e.g. https://www.example.com/api_autoresponder.php)
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
@bansicloud
bansicloud / collisionLSH.py
Created August 19, 2021 06:43 — forked from unrealwill/collisionLSH.py
Proof of Concept : generating collisions on a neural perceptual hash
import tensorflow as tf #We need tensorflow 2.x
import numpy as np
#The hashlength in bits
hashLength = 256
def buildModel():
#we can set the seed to simulate the fact that this network is known and doesn't change between runs
#tf.random.set_seed(42)
model = tf.keras.Sequential()
@bansicloud
bansicloud / getStripeCustomersViaEmail.php
Created December 21, 2020 13:44 — forked from aligajani/getStripeCustomersViaEmail.php
Retrieve Stripe Customers via email
<?php
$email = "your_email_query_here";
try {
$client = $client = new \GuzzleHttp\Client();
$client->setDefaultOption('verify', true);
$httpResource = 'https://api.stripe.com/v1/search?query="'.$email.'"&prefix=false';
$request = $client->get($httpResource, [
const request = require('superagent');
const checkItemInStock = async () => {
const {text: html} = await request.get(
'https://www.bowflex.com/selecttech/552/100131.html'
);
const inStock = html.toLowerCase().indexOf('out of stock') === -1;
return {inStock};
};
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1016" android:versionName="1.0.2" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" package="no.simula.smittestopp" platformBuildVersionCode="29" platformBuildVersionName="10">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
@bansicloud
bansicloud / snakecoin-server-full-code.py
Created February 11, 2018 06:09 — forked from aunyks/snakecoin-server-full-code.py
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash