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
#random сан нь санамсаргүй сонголт хийхэд ашиглагдана. random.choise | |
#os сан нь terminal дээр тушаал өгөхөд ашиглана. os.system('clear') | |
import random | |
import os | |
#hiden нь доорх үгнүүдээс санамсаргүй утга авна | |
hided = random.choice([ | |
'bmw', | |
'kia', | |
'lamborgini', |
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
def maxint(a, b): | |
"""Calculate maximum in a & b""" | |
return ((a+b)+(abs(a-b)))/2 | |
a=int(raw_input('a = ')) | |
b=int(raw_input('b = ')) | |
print maxint(a, b) |
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
#!/bin/bash | |
# Author: Khaschuluu | |
# Contact: http://twitter.com/khaschuluu | |
tmp=/tmp/tmp$$ | |
curl http://vimcasts.org/episodes/archive/ | grep -E '\/episodes' | grep '\"archive\"' | sed -r 's#(^.*"\/)(episodes.*)(" class="archive)(".*)#http:\/\/vimcasts\.org/\2#g' > $tmp-pages | |
cat $tmp-pages |\ | |
while read page_uri |
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]) |
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
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
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
# Матрицийг 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
<!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
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, |
OlderNewer