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
#define MESSAGE_TOTAL_LENGTH 301 | |
#define BIT_PERIOD 350 | |
#define DATA_PIN 4 | |
#include <SoftwareSerial.h> | |
const char *STR_REC_UNREAD = "\"REC UNREAD\""; | |
const char *STR_PHONE_NUMBER = "\"+98XXXXXXXXXX\""; | |
int data[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0, 0}; | |
int size = sizeof(data) / sizeof(int); |
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
#include <iostream> | |
#include <thread> | |
#include <functional> | |
int main(int argc, char *argv[]) { | |
int x = 1; | |
std::cout << "[1] x is " << x << std::endl; |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func(rw http.ResponseWriter, r *http.Request) { |
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 io.undertow.Undertow; | |
import io.undertow.server.HttpHandler; | |
import io.undertow.server.HttpServerExchange; | |
public class HelloWorldServer { | |
public static void main(final String[] args) { | |
Undertow server = Undertow.builder() | |
.addHttpListener(8081, "localhost") | |
.setHandler(new HttpHandler() { |
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 com.mongodb.MongoClient; | |
import com.mongodb.client.MongoCollection; | |
import com.mongodb.client.MongoCursor; | |
import com.mongodb.client.MongoDatabase; | |
import org.bson.Document; | |
import org.json.JSONArray; | |
import org.json.JSONObject; | |
import java.io.*; | |
import java.net.ServerSocket; |
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
package model | |
type User struct { | |
Id string `json:"id"` | |
Name string `json:"name"` | |
Coins int32 `json:"coins"` | |
Emojis []int32 `json:"emojis"` | |
CreatedAt int64 `json:"createdAt"` | |
} |
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
package routes | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"github.com/doorbash/my-api/model" | |
"github.com/gorilla/mux" | |
"go.mongodb.org/mongo-driver/bson" | |
"go.mongodb.org/mongo-driver/bson/primitive" |
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
package main | |
import ( | |
"context" | |
"github.com/doorbash/my-api/routes" | |
"go.mongodb.org/mongo-driver/mongo" | |
"go.mongodb.org/mongo-driver/mongo/options" | |
"log" | |
"net/http" | |
"time" |
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 com.badlogic.gdx.graphics.Texture; | |
import com.badlogic.gdx.graphics.g2d.SpriteBatch; | |
import com.badlogic.gdx.math.Matrix4; | |
import java.lang.reflect.Field; | |
/** | |
* Created by Milad Doorbash on 8/31/2019. | |
*/ | |
public class DebugSpriteBatch extends SpriteBatch { |
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
# 1. pip3 install telethon | |
# 2. Go to https://my.telegram.org/ and get api_id, api_hash | |
from telethon import TelegramClient, events, sync | |
import logging | |
logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s',level=logging.WARNING) | |
api_id = 12345 | |
api_hash = 'PUT-YOUR-API-HASH-HERE' |