Skip to content

Instantly share code, notes, and snippets.

@ZabihollahNamazi
ZabihollahNamazi / gist:0e154699dd3d3bc3381abf2784016c76
Created May 3, 2024 14:41
guess number using Flask / python
from flask import Flask
import random
app = Flask(__name__)
random_number = random.randint(0, 9)
print(random_number)
@app.route("/")
def main():
@CatalanCabbage
CatalanCabbage / dvsj-in-about-you.tsx
Created February 15, 2024 06:46
WIP, about you component that gets data from your browser and eerily shows your data
import React, {useEffect, useRef, useState} from 'react';
import './About.css';
let textOptions = {
cookieEnabled: {
true: '',
false: 'You\'ve turned cookies off? Wow. ',
}, platform: {
win: 'Chillin\' on your Windows'
}, deviceMemory : {
@fogleman
fogleman / words.md
Last active May 3, 2024 14:43
Mnemonic Encoding Word List

Mnemonic Encoding Word List

http://web.archive.org/web/20090918202746/http://tothink.com/mnemonic/wordlist.html

  • The wordlist contains 1626 words.
  • All words are between 4 and 7 letters long.
  • No word in the list is a prefix of another word (e.g. visit, visitor).
  • Five letter prefixes of words are sufficient to be unique.
  • The words should be usable by people all over the world. The list is far from perfect in that respect. It is heavily biased towards western culture and English in particular. The international vocabulary is simply not big enough. One can argue that even words like "hotel" or "radio" are not truly international. You will find many English words in the list but I have tried to limit them to words that are part of a beginner's vocabulary or words that have close relatives in other european languages. In some cases a word has a different meaning in another language or is pronounced very differently but for the purpose of the encoding it is still ok - I assume that when the encoding is
@ngsmrk
ngsmrk / sidekiq_monitoring
Created August 11, 2014 11:51
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed
@david-yappeter
david-yappeter / binding-1.go
Last active May 3, 2024 14:42
gqlgen data validation
package directives
import (
"context"
"github.com/99designs/gqlgen/graphql"
"github.com/go-playground/validator/v10"
)
var (
@A248
A248 / Minecraft Servers: Managing Permissions.md
Last active May 3, 2024 14:42
What are permissions in Minecraft? How do I use them on Spigot, BungeeCord, or Sponge?

Introduction

You probably know you can give yourself and your friends OP status on your server. OPs can use any commands; they can change gamemodes, broadcast messages, and generally do whatever is possible with the plugins you have installed. They're basically super-administrators, with no checks on their capabilities.

If you're only running a small server for friends, using OP is perfectly fine. If you only give OP to trusted friends, it's all fine.

@johnfedoruk
johnfedoruk / clamd-setup.md
Last active May 3, 2024 14:40
Setting up ClamAV

ClamAV Setup Notes

Context

ClamAV can be used in a few different ways. Most importantly, it provides the ability to scan files in realtime (on-access) or to scan the file system periodically.

I tried configuring ClamAV to both perform on-access virus scanning and to perform nightly full filesystem scanning. Using the on-access option did not prove to be very useful, however a scheduled full system scan seems to be of value.

Here is my story.

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@khattaksd
khattaksd / seed.sql
Created September 22, 2023 00:19
Supabase Seed Users for local development & testing
-- supabase/seed.sql
--
-- create test users
INSERT INTO
auth.users (
instance_id,
id,
aud,
role,
email,
[user]
name = Put In Your Own
email = I.aint@tellin.you
[alias]
# Shortcuts, cuz' I'm lazy
ci = commit
br = branch -v
bra = branch -v -a
co = checkout