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
# /etc/nginx/mime.types | |
types { | |
font/ttf ttf; | |
font/opentype otf; | |
text/html html htm shtml; | |
text/css css; | |
text/xml xml; | |
image/gif gif; | |
image/jpeg jpeg jpg; | |
application/javascript js; |
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
# remove specific file from git cache | |
git rm --cached filename | |
# remove all files from git cache | |
git rm -r --cached . | |
git add . | |
git commit -m ".gitignore is now working" |
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
// note: encoded data is NOT encrypted | |
const crypto = require('crypto'); | |
const secret = '20BBEBB8-DCC1-4544-AD32-7F3973CCED7A'; | |
function createDigest(encodedData, format) { | |
return crypto | |
.createHmac('sha256', secret) | |
.update(encodedData) | |
.digest(format); |
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 React from 'react' | |
import Button from 'react-bootstrap/Button'; | |
import * as FileSaver from 'file-saver'; | |
import * as XLSX from 'xlsx'; | |
export const ExportCSV = ({csvData, fileName}) => { | |
const fileType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8'; | |
const fileExtension = '.xlsx'; |
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
server { | |
root /var/www/html; | |
index index.html index.htm index.nginx-debian.html; | |
server_name example.com; | |
include /etc/nginx/mime.types; | |
} | |
server { | |
if ($host = example.com) { |
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
String.prototype.turkishtoEnglish = function () { | |
return this.replace('Ğ','g') | |
.replace('Ü','u') | |
.replace('Ş','s') | |
.replace('I','i') | |
.replace('İ','i') | |
.replace('Ö','o') | |
.replace('Ç','c') | |
.replace('ğ','g') | |
.replace('ü','u') |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
import sys | |
if (sys.version_info < (3, 0)): | |
# Python 3 code in this block | |
print('Python v3.5 or above required for Instaloader module at the moment. Exiting...') | |
quit() |
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
# copied from https://github.com/tulir/mautrix-telegram/blob/master/mautrix_telegram/util/parallel_file_transfer.py | |
# Copyright (C) 2021 Tulir Asokan | |
import asyncio | |
import hashlib | |
import inspect | |
import logging | |
import math | |
import os | |
from collections import defaultdict | |
from typing import Optional, List, AsyncGenerator, Union, Awaitable, DefaultDict, Tuple, BinaryIO |
NewerOlder