Skip to content

Instantly share code, notes, and snippets.

View Stringsaeed's full-sized avatar
🏗️
building something that matters

Muhammad Saeed Stringsaeed

🏗️
building something that matters
View GitHub Profile
@Stringsaeed
Stringsaeed / pixel.ts
Last active February 19, 2022 20:06
Create a pixel perfect design in react native
import {Dimensions} from 'react-native';
const {height: SCREEN_HEIGHT, width: SCREEN_WIDTH} = Dimensions.get('window');
const designSize = {width: 390, height: 844};
const CURRENT_RESOLUTION = Math.sqrt(
SCREEN_HEIGHT * SCREEN_HEIGHT + SCREEN_WIDTH * SCREEN_WIDTH,
);
const DESIGN_RESOLUTION = Math.sqrt(
designSize.height * designSize.height + designSize.width * designSize.width,
import {
DatabaseInterface,
ConnectionInformations,
CreateUser,
User as AccountsUser,
} from '@accounts/types';
import {
PrismaClient,
Prisma,
User,
import { useCallback, useState } from 'react';
// Usage
function App() {
// Call the hook which returns, current value and the toggler function
const [isTextChanged, setIsTextChanged] = useToggle();
return (
<button onClick={setIsTextChanged}>{isTextChanged ? 'Toggled' : 'Click to Toggle'}</button>
@Stringsaeed
Stringsaeed / textrank.py
Created February 12, 2019 15:51
This is a naive implementation of textrank algorithm to summarize some text, I just looking for edits
import re
import string
import networkx as nx
from nltk import pos_tag
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from textblob.wordnet import NOUN, VERB, ADJ, ADV
from sklearn.metrics.pairwise import cosine_similarity
_WORD_PAT = r"\w[\w']{3,}"