Skip to content

Instantly share code, notes, and snippets.

View falahgs's full-sized avatar

Falah Gate Salieh falahgs

View GitHub Profile
@falahgs
falahgs / specific-part-of-coco-dataset-package.ipynb
Last active June 14, 2022 19:30
Specific Part of COCo Dataset package
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@falahgs
falahgs / cocodataset
Created June 2, 2021 14:11
Determining Specific Part of CoCo Dataset
Determining Specific Part of CoCo Dataset
with open('open_images_train_captions.jsonl', 'r') as json_file:
json_list = json_file.read().split('\n')
np.random.shuffle(json_list)
data = []
N = 100000
for ix, json_str in Tqdm(enumerate(json_list), N):
if ix == N: break
try:
result = json.loads(json_str)
x = pd.DataFrame.from_dict(result, orient='index').T
@falahgs
falahgs / colab_download.py
Created November 15, 2018 18:12 — forked from korakot/colab_download.py
Google colab file upload/download
files.download('example.txt') # from colab to browser download
@falahgs
falahgs / PlantMoistureSensor.ino
Created March 23, 2018 13:16 — forked from pudelosha/PlantMoistureSensor.ino
Arduino ESP8266 WiFi MySQL database connection with INSERT SQL command
//#include <DHT.h>
#include <MySQL_Connection.h>
#include <MySQL_Cursor.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#define sensorPin1 0
//#define sensorPin2 D2
//#define typeDHT DHT11
@falahgs
falahgs / webhook.php
Created April 12, 2017 14:59 — forked from visitdigital/webhook.php
Very Simple Facebook Chat Bot PHP Webhook Script Example
<?php
$challenge = $_REQUEST['hub_challenge'];
$verify_token = $_REQUEST['hub_verify_token'];
// Set this Verify Token Value on your Facebook App
if ($verify_token === 'testtoken') {
echo $challenge;
}
$input = json_decode(file_get_contents('php://input'), true);
@falahgs
falahgs / facebook-messenger-bot.php
Created April 12, 2017 13:54 — forked from remmel/facebook-messenger-bot.php
Basic example of a Facebook Messenger Bot
<?php
// parameters
$hubVerifyToken = 'TOKEN123456abcd';
$accessToken = "xxx";
// check token at setup
if ($_REQUEST['hub_verify_token'] === $hubVerifyToken) {
echo $_REQUEST['hub_challenge'];
exit;
}