Skip to content

Instantly share code, notes, and snippets.

View moh-affan's full-sized avatar
💭
🥰💻

Moh. Affan moh-affan

💭
🥰💻
View GitHub Profile
@jogboms
jogboms / main.dart
Created November 16, 2021 10:59
Light Gradient Knob
import 'dart:math' as math;
import 'dart:ui';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
void main() => runApp(
MaterialApp(
@Shaikot007
Shaikot007 / Cash register
Last active June 11, 2024 06:16
Cash register. (freeCodeCamp JavaScript algorithms and data structures challenge)
function checkCashRegister(price, cash, cid) {
var change = cash - price;
var coinValues = [
{ name: 'ONE HUNDRED', val: 100.00 },
{ name: 'TWENTY', val: 20.00 },
{ name: 'TEN', val: 10.00 },
{ name: 'FIVE', val: 5.00 },
{ name: 'ONE', val: 1.00 },
{ name: 'QUARTER', val: 0.25 },
@JakubOboza
JakubOboza / private-docker-regs-with-free-tiers.markdown
Created May 30, 2019 07:15
Private Docker registry with free tiers for Developers.

List of sites with free tier limits

  • Docker Hub - One private repo/image spot for free
  • Three Scale - Very generous free tier 50GB of space, 500 Pulls a month etc..
  • Canister - 20 private repos with almost no limits on free tier
  • Code Fresh - Free tier for developers

Setup your own private registry

@multiarts
multiarts / ClipShadowPath.dart
Last active October 16, 2024 20:06 — forked from coman3/ClipShadowPath.dart
Updated to null safety
import 'package:flutter/material.dart';
class ClipShadowPath extends StatelessWidget {
final Shadow shadow;
final CustomClipper<Path> clipper;
final Widget child;
const ClipShadowPath({
Key? key,
required this.shadow,
import 'package:flutter/material.dart';
@immutable
class ClipShadowPath extends StatelessWidget {
final Shadow shadow;
final CustomClipper<Path> clipper;
final Widget child;
ClipShadowPath({
@required this.shadow,
@gaearon
gaearon / index.html
Last active October 21, 2025 03:08
Multiple React components on a single HTML page
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@gaearon
gaearon / index.html
Last active March 11, 2026 14:30
Add React in One Minute
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@azanium
azanium / jwtRS512.sh
Last active May 15, 2024 18:03 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS512 key
ssh-keygen -t rsa -b 4096 -e SHA512 -f jwtRS512.key
# Don't add passphrase
openssl rsa -in jwtRS512.key -pubout -outform PEM -out jwtRS512.key.pub
cat jwtRS512.key
cat jwtRS512.key.pub
@rluts
rluts / token_auth.py
Last active April 10, 2025 16:38
Token authorization middleware for Django Channels 2
from channels.auth import AuthMiddlewareStack
from rest_framework.authtoken.models import Token
from django.contrib.auth.models import AnonymousUser
from django.db import close_old_connections
class TokenAuthMiddleware:
"""
Token authorization middleware for Django Channels 2
"""
@mortenege
mortenege / django_channels_with_vagrant_apache_supervisor.md
Created March 4, 2018 06:56
Django Channels with Vagrant, Apache and Supervisor

Django Channels with Vagrant, Apache and Supervisor

This post describes how to set up a Django Channels environment in Vagrant using Apache as a reverse proxy. We are picking up from an environment we already configured, see this previous post. This guide will describe multiple steps of the process including:

  • How to install and configure Channels
  • Creating a simple Echo app that utilises websockets
  • Configuring Apache to route our websockets
  • Running Channels in a production-like environment

Step 1