Skip to content

Instantly share code, notes, and snippets.

View fport's full-sized avatar
🍊
osman mod on

Furkan Portakal fport

🍊
osman mod on
View GitHub Profile
@fport
fport / Swipeable
Created May 8, 2024 11:11
Swipeable
'use client'
import React, {useState, ReactNode} from "react";
// https://stackoverflow.com/questions/70612769/how-do-i-recognize-swipe-events-in-react
export default function Swipeable(props:SwipeableProps) {
const [touchStartX, setTouchStartX] = useState(null)
const [touchEndX, setTouchEndX] = useState(null)
@fport
fport / readme.md
Created March 12, 2024 20:19 — forked from cagataycali/readme.md
Run multimodal llm (llava with llamafile) and open browser after the model start.

Install

[wget ... or download](https://gist.github.com/acaa476865821b02813b8a8e88e59c13.git)
chmod +x run-local-multimodal-llm-openai-compatible.sh
./run-local-multimodal-llm-openai-compatible.sh
https://eng.m.fontke.com/family/1352930/style/
@fport
fport / settings.md
Created March 5, 2023 17:52 — forked from mehmetsagir/settings.md
Eslint, Prettier, husky and lint-staged configurations for TypeScript projects

If husky is not running, run the following command

chmod ug+x .husky/*

Installation

Install dependencies

yarn add -D prettier eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-simple-import-sort husky lint-staged
@fport
fport / redux-state-sync.js
Created January 10, 2023 15:56
Provides state synchronization between tabs
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.initMessageListener = exports.initStateWithPrevTab = exports.withReduxStateSync = exports.createReduxStateSync = exports.createStateSyncMiddleware = exports.WINDOW_STATE_SYNC_ID = exports.INIT_MESSAGE_LISTENER = exports.RECEIVE_INIT_STATE = exports.SEND_INIT_STATE = exports.GET_INIT_STATE = undefined;
exports.generateUuidForAction = generateUuidForAction;
exports.isActionAllowed = isActionAllowed;
exports.isActionSynced = isActionSynced;
exports.MessageListener = MessageListener;
import React, { useState, useEffect } from 'react';
const PdfUploadForm = () => {
const [pdf, setPdf] = useState(null);
const handleChange = (event) => {
setPdf(event.target.files[0]);
}
const handleSubmit = (event) => {
@fport
fport / node_nginx_ssl.md
Created November 9, 2022 21:50 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@fport
fport / gist:631eff5fc716f77ff59bfba5d5ecf060
Created July 27, 2022 08:48
identification node version(zshrc code) for .nvmrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
@fport
fport / mergeExistingObject.js
Last active February 22, 2022 02:52
mergeExistingObject
const mergeExistingObject = (source ,target) => {
return Object.keys(source)
.reduce((a, key) => ({ ...a, [key]: target[key]}), {});
}
@fport
fport / vimrc.txt
Last active June 20, 2022 19:02
new vimrc
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" -----------------------------
" IMPORTANT:
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo