Skip to content

Instantly share code, notes, and snippets.

View muhammedfurkan's full-sized avatar
🙃

M.Furkan muhammedfurkan

🙃
View GitHub Profile
@muhammedfurkan
muhammedfurkan / mime.types
Created September 11, 2023 16:51 — forked from marlosirapuan/mime.types
NGINX Config - Content-Security-Policy (Google, Google Fonts, Facebook, Zendesk, MaxCDN-FontAwesome, CKEditor), Cache, Mime-Types, Puma
# /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;
# 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"
@muhammedfurkan
muhammedfurkan / encode_decode_hmac.js
Created May 4, 2023 13:59 — forked from fictorial/encode_decode_hmac.js
encode / decode with hmac for node.js
// 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);
@muhammedfurkan
muhammedfurkan / ExportCSV.js
Created February 3, 2023 11:43 — forked from bbachi/ExportCSV.js
react excel functionality
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';
@muhammedfurkan
muhammedfurkan / AES-CBC-PKCS5PADDING.md
Created February 1, 2023 06:52 — forked from kcak11/0000.md
AES/CBC/PKCS5PADDING - Java/Javascript (Encryption & Decryption)

AES/CBC/PKCS5PADDING - Java/Javascript (Encryption & Decryption)

@muhammedfurkan
muhammedfurkan / AUTO_DEPLOY.md
Created November 3, 2022 07:26 — forked from zihadmahiuddin/AUTO_DEPLOY.md
GitHub Auto Deploy for NodeJS apps using Webhooks
@muhammedfurkan
muhammedfurkan / example.com
Created September 26, 2022 06:39
NGINX installation with Let's Encrypt
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) {
@muhammedfurkan
muhammedfurkan / odev1.py
Last active June 21, 2022 18:45
odev 1 çözüm
data = {
"pazartesi": 0,
"sali": 0,
"carsamba": 0,
"persembe": 0,
"cuma": 0,
"cumartesi": 0,
"pazar": 0,
"toplam": 0,
}
@muhammedfurkan
muhammedfurkan / js-turkish-to-english.js
Created June 17, 2022 08:09 — forked from enginkartal/js-turkish-to-english.js
Javascript Turkish character to english characters change
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')
def prettyjson(obj, indent=2, maxlinelength=80):
"""Renders JSON content with indentation and line splits/concatenations to fit maxlinelength.
Only dicts, lists and basic types are supported"""
items, _ = getsubitems(obj, itemkey="", islast=True,
maxlinelength=maxlinelength - indent, indent=indent)
return indentitems(items, indent, level=0)
def getsubitems(obj, itemkey, islast, maxlinelength, indent):