Skip to content

Instantly share code, notes, and snippets.

View khalby786's full-sized avatar
donuts

Khaleel Gibran khalby786

donuts
View GitHub Profile
@thingsinjars
thingsinjars / LICENSE.txt
Created December 8, 2011 21:56 — forked from 140bytes/LICENSE.txt
Attach a handler to generate a draggable file on the fly
DO WHATEVER YOU MIGHT WISH TO PUBLIC LICENSE
Version 1, December 2011
Copyright (C) 2011 SIMON MADINE <http://thingsinjars.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHATEVER YOU MIGHT WISH TO PUBLIC LICENSE
@graste
graste / API.md
Created August 22, 2012 19:23 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@evanwill
evanwill / gitBash_windows.md
Last active July 16, 2024 23:51
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@345161974
345161974 / splashscreen_demo_1.py
Created March 15, 2017 13:02
PyQt SplashScreen Demo
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import time
class Form(QDialog):
""" Just a simple dialog with a couple of widgets
"""
def __init__(self, parent=None):
super(Form, self).__init__(parent)
@9b
9b / what_runs.py
Created August 26, 2017 03:51
Simple tool to use WhatRuns API to get technologies used on a page. Doesn't submit the page if it's not in the database.
import ast
import datetime
import json
import sys
import requests
import urllib
from tabulate import tabulate
url = "https://www.whatruns.com/api/v1/get_site_apps"
data = {"data": {"hostname": sys.argv[1], "url": sys.argv[1],
@oliveratgithub
oliveratgithub / emojis.json
Last active July 21, 2024 14:56
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "&#128104;&zwj;&#128105;&z
@nvbn
nvbn / app.py
Last active March 11, 2023 13:16
Sound lights with spotify, esp8266 and neopixel strip
from __future__ import annotations
import array
import asyncio
from bisect import bisect_left
from dataclasses import dataclass
import logging
import os
import socket
import time
@jaames
jaames / fancy-css-links.md
Last active April 13, 2022 09:20
Fancy CSS link underlines with inline SVGs (plus embedded animations!)
@khalby786
khalby786 / server.js
Created August 26, 2020 11:27
GitHub oAuth Login with Express & without Passport.js
const express = require("express");
const app = express();
var session = require('express-session');
const fetch = require('node-fetch');
const clientID = process.env.CLIENT_ID;
const clientSecret = process.env.CLIENT_SECRET;
async function getAccessToken(code, client_id, client_secret) {
const request = await fetch("https://github.com/login/oauth/access_token", {

Going static isn't so bad

In fact some people called it a stack called JAMStack. Here are ways you can make static apps that are still as cool as server side apps.

How do I make stuff only show when someone enters a password

  1. Encrypt something with your password as the key
  2. Put it on the webpage. When someone enters the password attempt to decrypt using the same key(please use non-bruteforcable encryption so don't use the Vigenere cipher for this). If it's successful show the decrypted content.

Suppose someone is answering a math problem how do I make it so they can't just hack and find the answer without checking the answer on the server side

Hash the answer and when the user presses a button to check their answers just hash their input and compare. In addition, use a similiar method like the blockchain and add a really long salt to make computation slower so it isn't bruteforcable.

How do I make it so people can load data and save data from other people

  • You c