Skip to content

Instantly share code, notes, and snippets.

View drpshtiwan's full-sized avatar
🏠
Working from home

Dr. Pshtiwan drpshtiwan

🏠
Working from home
View GitHub Profile
@fredgrott
fredgrott / MainActivity.kt
Created April 15, 2021 16:48
full screen work-arounds for android using flutter native kotlin
import android.os.Build
import android.view.WindowManager
import androidx.core.view.WindowCompat
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
@jebright
jebright / main.dart
Created April 16, 2019 19:12
Using an Isolate in Flutter
import 'dart:async';
import 'package:flutter/material.dart';
import 'dart:isolate';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@jeffochoa
jeffochoa / Errors.js
Last active February 9, 2022 09:52
Vue Form and Error validator (Laracasts)
class Errors {
/**
* Create a new Errors instance.
*/
constructor() {
this.errors = {};
}
/**
@wojteklu
wojteklu / clean_code.md
Last active April 18, 2025 12:16
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@hotmeteor
hotmeteor / generate_timezone_list.php
Last active October 27, 2024 04:28
[PHP] Generate a timezone list with optgroups
/**
* Inspired by http://stackoverflow.com/questions/1727077/generating-a-drop-down-list-of-timezones-with-php
* @return array
*/
function generate_timezone_list()
{
static $regions = [
'Africa' => DateTimeZone::AFRICA,
'Americas' => DateTimeZone::AMERICA,
@plentz
plentz / nginx.conf
Last active April 16, 2025 17:25
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048