This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dependencies: Python 3+, ImageMagick | |
from os import listdir, system, makedirs | |
from os.path import isfile, join, splitext | |
from multiprocessing import Pool | |
import errno | |
import argparse | |
def make_sure_path_exists(path): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
fi | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bash/zsh completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# | |
# *) local and remote branch names | |
# *) local and remote tag names |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class BreathingWidget extends StatefulWidget { | |
final Widget child; | |
const BreathingWidget({Key key, @required this.child}) : super(key: key); | |
@override | |
_BreathingWidgetState createState() => _BreathingWidgetState(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class TiltableStack extends StatefulWidget { | |
final List<Widget> children; | |
final Alignment alignment; | |
const TiltableStack({ | |
Key key, | |
this.children, | |
this.alignment = Alignment.center, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Purpose: Shell script to connect a USB connected device via adb over WiFi | |
# | |
# Author: Amanshu Raikwar | |
# | |
# Assumptions: | |
# 1. USB debugging is enabled in the Android device | |
# 2. The Android device is connected to the computer via USB | |
# 3. The Android device is connected to the same wifi as the computer | |
# 4. The Android device is accessible through port 5555 over the wifi network | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) => MaterialApp( | |
home: TiltedPyramid(), | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Loops through all fields in the receiving object and looks for fields | |
* with the same name in the sending object. Then it tries to copy non-null | |
* values to the receiving object, and silently fails when something goes wrong | |
* | |
* Don't use this | |
*/ | |
fun Any.update(new: Any) = javaClass.declaredFields.forEach { field -> | |
try { | |
field.isAccessible = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension ScopingFunctions<T> on T { | |
/// Calls the specified function [block] with `this` value | |
/// as its argument and returns its result. | |
R let<R>(R Function(T) block) => block(this as T); | |
/// Calls the specified function [block] with `this` value | |
/// as its argument and returns `this` value. | |
T also(void Function(T) block) { | |
block(this as T); | |
return this as T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
Foo? foo; | |
foo?.bar ??= 666; | |
print(foo); | |
foo = Foo()..bar = 666; | |
print(foo.bar); |
OlderNewer