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
const https = require('https') | |
const fs = require('fs') | |
const agent = new https.Agent({keepAlive: true}) | |
const qs = require('querystring') | |
const Web3 = require('web3') | |
const web3 = new Web3() | |
const crypto = require('crypto') | |
const EthereumTx = require('ethereumjs-tx') | |
const Datastore = require('@google-cloud/datastore'); |
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
const request = require("request"); | |
const {Datastore} = require('@google-cloud/datastore'); | |
const datastore = new Datastore({keyFilename: './gcpkey.json'}); | |
const callSendAPI = (sender_id, body) => { | |
let request_body = { | |
recipient: { | |
id: sender_id | |
}, |
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 is a Telegram Bot that get's message command from group that have this bot. For this example: | |
// When someone send message comand like `/lunch`, then it reply random restaruant name etc. | |
const functions = require('@google-cloud/functions-framework'); | |
var TelegramBot = require('telegrambot'); | |
var api = new TelegramBot('9999999999:AAAA_bbbb-cccDD-EEEEEEEEEE-9999-FFF'); | |
const restaurants = [ | |
"Samgyopsal", | |
"Dino", | |
"Arig", |
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
const puppeteer = require('puppeteer') | |
const stats = require('./stats.json') | |
const fs = require('fs') | |
const { promisify } = require("util") | |
const writeFile = promisify(fs.writeFile) | |
; | |
(async () => { | |
const puppet = await puppeteer.launch({ | |
headless: false, |
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
<!doctype html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<script type="text/javascript"> | |
//separatrix numeral (like european) | |
numeral = { | |
sne: [ | |
"мянга", |
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
# Матрицийг row мөр, col баганатайгаар үүсгэнэ. | |
# Жагсаалт үүсгээд, жагсаалт дотороо дахин row тооны жагсаалт үүсгээд, | |
# жагсаал доторх жагсаалт бүрийг col тооны 0 элемэнтээр дүүргэнэ. | |
def matrix(row, col): | |
matrix = [] | |
for i in xrange(row): | |
matrix.append([]) | |
for j in xrange(col): | |
matrix[i].append(0) | |
return matrix |
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
print_r($_FILES); | |
print_r($_POST); | |
move_uploaded_file($_FILES["file"]["tmp_name"], "uploads/" . ((isset($_POST["filename"])&&$_POST["filename"]!=null)?$_POST["filename"]:$_FILES["file"]["name"])); |
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
function js_upload(upload_field) | |
{ | |
//upload_field.form.submit(); // гээд шууд submit хийж болно | |
//Доор энгийн Ajax үүсгэж байна | |
var xmlhttp; | |
if (window.XMLHttpRequest) | |
{ | |
xmlhttp = new XMLHttpRequest(); | |
} |
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
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | |
<script src="http://code.jquery.com/jquery-1.4.4.min.js"></script> | |
</head> | |
<body> | |
<table border=1> | |
<?php | |
$html = file_get_contents('http://www.khanbank.com/mn/294/%D0%A5%D0%B0%D0%BD%D1%88%D0%B8%D0%B9%D0%BD-%D0%BC%D1%8D%D0%B4%D1%8D%D1%8D.html'); |
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 random | |
import os | |
def drawBoard(board): | |
# This function prints out the board that it was passed. | |
# "board" is a list of 10 strings representing the board (ignore index 0) | |
os.system('clear') | |
print(' | |') | |
print(' ' + board[7] + ' | ' + board[8] + ' | ' + board[9]) |
NewerOlder