Skip to content

Instantly share code, notes, and snippets.

View fatemehkarimi's full-sized avatar
♟️
about to promote

Fatemeh Karimi fatemehkarimi

♟️
about to promote
View GitHub Profile
import React, { useState, useEffect } from "react";
import axios from "axios";
const App = () => {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const [user, setUser] = useState();
useEffect(() => {
const loggedInUser = localStorage.getItem("user");
@howCodeORG
howCodeORG / algo.py
Created May 12, 2018 01:35
howCode's Simple Genetic Algorithm in Python
import random
population = 200
generations = 0
mutation = 0.01
alphabet = "abcdefghijklmnopqrstuvwxyz! "
target = "subscribe to howcode!"
output = ""
data = []
@rproenca
rproenca / Clipboard.js
Last active May 28, 2024 08:57
Copy text to clipboard using Javascript. It works on Safari (iOS) and other browsers.
window.Clipboard = (function(window, document, navigator) {
var textArea,
copy;
function isOS() {
return navigator.userAgent.match(/ipad|iphone/i);
}
function createTextArea(text) {
textArea = document.createElement('textArea');
@nickoala
nickoala / 0_python_email.md
Last active June 16, 2024 12:58
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria
@komamitsu
komamitsu / gist:c2a5c46a22d765df5aa2
Created February 11, 2015 08:01
Fibonacci number with "with recursive" in PostgreSQL
with recursive r(a, b) as (
select 0::int, 1::int
union all
select b, a + b from r where b < 1000
)
select a from r;
a
-----
0