Skip to content

Instantly share code, notes, and snippets.

@myazarc
myazarc / ders2.js
Created December 20, 2023 20:39
ders2.js
const http = require("http");
const urlParser = require("url");
// GET, POST
// http://localhost:3000/kategoriler
// http://localhost:3000/?name=John&age=20
// http://localhost:3000/
http
.createServer((req, res) => {
@myazarc
myazarc / app.js
Last active February 12, 2022 02:57
const fs = require("fs");
const Promise = require("bluebird");
Promise.config({
cancellation: true,
});
const TelegramBot = require("node-telegram-bot-api");
const token = `TOKEN`;
const bot = new TelegramBot(token, { polling: true });
@myazarc
myazarc / rsi.js
Created December 6, 2021 21:29
RSI Js calc
const calcGain = (values, period = 14) => {
var results = [];
var counter = 1;
var gainSum = 0;
var avgGain;
var gain;
for (let i = 1; i < values.length; i++) {
var currentValue = values[i];
{% apply spaceless %}
<?xml version="1.0" encoding="utf-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
<ext:UBLExtensions>
<ext:UBLExtension>
<ext:ExtensionContent/>
</ext:UBLExtension>
</ext:UBLExtensions>
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
<cbc:CustomizationID>TR1.2</cbc:CustomizationID>
@myazarc
myazarc / average-geolocation.js
Created September 18, 2019 13:33 — forked from tlhunter/average-geolocation.js
Calculate the center/average of multiple GeoLocation coordinates
/**
* Calculate the center/average of multiple GeoLocation coordinates
* Expects an array of objects with .latitude and .longitude properties
*
* @url http://stackoverflow.com/a/14231286/538646
*/
function averageGeolocation(coords) {
if (coords.length === 1) {
return coords[0];
}
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
<template>
<view class="container">
<view class="top-container"><text>a</text>
</view>
<view class="bottom-container">
<view class="container-content">
<touchable-opacity class="content-button">
<linear-gradient class="button-linear-gradient" :colors="['rgba(255,255,255,1)','rgba(237,237,237,1)']">
<m-icon ios="ios-repeat" android="md-repeat" :size="34"/>
@myazarc
myazarc / procces.php
Created November 5, 2018 14:31
PHP Multi Thread
<?php
class procces {
private $dir;
public function setDir($dir) {
$this->dir=$dir;
}
public function add($pidFileName, $outputFileName, $runningFileDir) {