Skip to content

Instantly share code, notes, and snippets.

View bnayagrawal's full-sized avatar
💭
Away

Binay Agrawal bnayagrawal

💭
Away
View GitHub Profile
@wouterhardeman
wouterhardeman / main.dart
Created December 4, 2018 19:48
Custom error screen in Flutter
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
Widget getErrorWidget(FlutterErrorDetails error) {
return Center(
child: Text("Error appeared."),
);
}
@gildaswise
gildaswise / rounded_modal.dart
Last active October 7, 2021 09:39
A custom implementation of the showModalBottomSheet, with rounded corners
import 'dart:async';
import 'package:flutter/material.dart';
/// Below is the usage for this function, you'll only have to import this file
/// [radius] takes a double and will be the radius to the rounded corners of this modal
/// [color] will color the modal itself, the default being `Colors.white`
/// [builder] takes the content of the modal, if you're using [Column]
/// or a similar widget, remember to set `mainAxisSize: MainAxisSize.min`
/// so it will only take the needed space.
@AkshayChordiya
AkshayChordiya / ApiResponse.java
Last active February 3, 2024 01:47
LiveData adapter for Retrofit
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.util.ArrayMap;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@pantuts
pantuts / gist:13623a7ba5e7e1c4ce44
Created March 29, 2016 12:38
i3 wm shutdown/reboot/logout mode
# Create Log out, Reboot, Poweroff bindings
mode "Exit (L)ogout, (R)eboot, (P)oweroff" {
bindsym $mod+r exec systemctl reboot
bindsym $mod+l exit
bindsym $mod+p exec systemctl poweroff
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
@kasperpeulen
kasperpeulen / README.md
Last active February 20, 2024 02:52
How to pretty-print JSON using Dart.
@broady
broady / 1MarkerAnimation.java
Last active March 13, 2024 12:44
Animating Markers
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 22, 2024 04:43
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@masak
masak / explanation.md
Last active May 21, 2024 20:05
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@alkavan
alkavan / linux_console_commands.sh
Last active August 29, 2023 11:23
All kind of useful Linux commands.
# I book marked some sites with useful Linux commands i found.
# then i noticed they were down, so i loaded them via google cache, and copied here.
# source: http://blog.urfix.com/
# source: http://www.pixelbeat.org/cmdline.html
# Enjoy!
# How to run process as background and never die
#
# nohup means: Do not terminate this process even when the stty is cut off.
# > /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output).