Skip to content

Instantly share code, notes, and snippets.

View abdurrahmanekr's full-sized avatar
🇹🇷
The mind is superior to the mind.

Avare Kodcu abdurrahmanekr

🇹🇷
The mind is superior to the mind.
View GitHub Profile
const http = require('http')
const url = require('url')
const { google } = require('googleapis')
const fs = require('fs')
const { web: credentials } = require('./client_secret.json')
const oauth2Client = new google.auth.OAuth2(
credentials.client_id,
credentials.client_secret,
'http://localhost:3000' // this is our redirect url for the authorization.
@rkdgusrn1212
rkdgusrn1212 / image_gamma_correction.py
Last active December 4, 2021 10:35
Image Gamma Correction using Pillow in Python.
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
gray_img = Image.open('Lenna.png').convert("LA")#밝기와 알파값을 이용해서 Grayscale로 변환
gray_img.save("lenna_gray.png")#grayscale로 변환된 흑백 이미지를 출력
row = gray_img.size[0]
col = gray_img.size[1]
gamma1 = 0.88
@fabiomontefuscolo
fabiomontefuscolo / new-of-plugin-dev.markdown
Last active August 18, 2023 22:01
Starting plugin development in Openfire

New Openfire Plugin

Install requirements

$ sudo pacman -S \
	intellij-idea-community-edition \
	jre8-openjdk \
	maven
@tsilvers
tsilvers / macUint64.go
Created August 25, 2017 19:39
Golang code to get MAC address for purposes of generating a unique id. Returns a uint64. Skips virtual MAC addresses (Locally Administered Addresses).
package main
import (
"bytes"
"fmt"
"net"
)
func main() {
fmt.Printf("MAC: %16.16X\n", macUint64())
@wahyudibo
wahyudibo / default.conf
Last active April 25, 2020 23:13
Install nginx, php 70 (with fpm), and mysql in Mac OS X
server {
listen 80;
server_name localhost;
root /Users/wahyudibo/Projects/mylabs/php/nginx;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
@jarretmoses
jarretmoses / React Native Clear Cache
Last active March 11, 2024 10:20
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@ygotthilf
ygotthilf / jwtRS256.sh
Last active April 17, 2024 04:10
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@v0lkan
v0lkan / nginx.conf
Last active April 2, 2024 18:25
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@jshaw
jshaw / byobuCommands
Last active April 18, 2024 05:59
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@taterbase
taterbase / upload.php
Created May 13, 2012 15:03
Simple file upload in php
<!DOCTYPE html>
<html>
<head>
<title>Upload your files</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>