Skip to content

Instantly share code, notes, and snippets.

View mustafakibar's full-sized avatar
:octocat:
kibar

kibar mustafakibar

:octocat:
kibar
View GitHub Profile
@andrelsmoraes
andrelsmoraes / bottom_sheet.dart
Created June 22, 2018 21:03
Modal Bottom Sheet with Input Fields fix for Flutter (Fix issue with overlap with keyboard and fix for tapping to dismiss) - Flutter Version: Channel beta, v0.5.1
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
@ctrleffive
ctrleffive / android.java
Last active April 21, 2023 03:19
Flutter platform channel sample code.
// ...
import io.flutter.app.FlutterActivity;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
// ...
public class MainActivity extends FlutterActivity {
@sebmarkbage
sebmarkbage / The Rules.md
Last active April 22, 2024 04:41
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@Aaronmacaron
Aaronmacaron / install-alacritty-ubuntu.sh
Last active October 10, 2022 11:26
Install Alacritty on Ubuntu
#!/bin/bash
# This installs alacritty terminal on ubuntu (https://github.com/jwilm/alacritty)
# You have to have rust/cargo installed for this to work
# Install required tools
sudo apt-get install -y cmake libfreetype6-dev libfontconfig1-dev xclip
# Download, compile and install Alacritty
git clone https://github.com/jwilm/alacritty
@nelsnelson
nelsnelson / public_dns_servers.md
Created April 23, 2018 16:07
Public DNS Servers
@MariaJackson1
MariaJackson1 / Custom Font @font-face
Last active September 15, 2022 19:59
Custom Fonts @font-face #typography #fonts
https://docs.generatepress.com/article/adding-local-fonts/
https://google-webfonts-helper.herokuapp.com/fonts
/* Local Fonts */
/* oswald-600 - latin */
@font-face {
font-family: 'Oswald';
font-style: normal;
font-weight: 600;
font-display: swap;
@superseb
superseb / cleanup.sh
Last active June 19, 2023 10:03
Cleanup host added as custom to Rancher 2.0
#!/bin/sh
# OUTDATED: please refer to the link below for the latest version:
# https://github.com/rancherlabs/support-tools/blob/master/extended-rancher-2-cleanup/extended-cleanup-rancher2.sh
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -rf $dir
done
@echo off
set "ip="
for /f "tokens=1-2 delims=:" %%a in ('ipconfig^|find "Default"') do if not defined ip set ip=%%b
echo %ip%
adb tcpip 5555
adb connect %ip%
adb devices
@chlab
chlab / README.md
Last active April 28, 2021 09:48
vue webpack boilerplate: how to add env-specific build targets

When using the vue-webpack-boilerplate, you will have only a production build by default (besides dev and test setups). My team often has at least another environment we call "staging" where the client can test new features before we move them to production. Oftentimes, these environments will have env-specific config values, like a different API URL.

With the changes outlined below, you can create a separate config per environment. This assumes you've created a Vue.js project with vue-webpack-boilerplate.

  1. Apply the changes to the corresponding files in your project as outlined below
  2. Now, when you run npm run build staging it will build your project with the config values specific to your staging environment. You can easily add any number of other environments and build them the same way. npm run build or npm run build production will still build your production environment.
@SzymonGrochowiak
SzymonGrochowiak / turn_off_airplane_mode.bat
Created November 14, 2017 17:02
Turn on/off airplane mode
adb shell settings put global airplane_mode_on 0 & adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false