Skip to content

Instantly share code, notes, and snippets.

View kirimi's full-sized avatar

Kirill Mironov kirimi

View GitHub Profile
@slightfoot
slightfoot / defer_init.dart
Last active July 19, 2023 12:51
Defer initialization of your UI based on a background service - by Simon Lightfoot - 29/12/2020 - Null Safe!
import 'dart:math' show Random;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show RendererBinding;
void main() {
runApp(MaterialApp(
home: Home(),
));
}
@jeroen-meijer
jeroen-meijer / fluttercleanrecursive.sh
Created September 15, 2019 13:00
Flutter Clean Recursive - Clear up space on your hard drive by cleaning your Flutter projects. This script searches for all Flutter projects in this directory and all subdirectories and runs 'flutter clean'. Note: may take a long time for folders with large amounts of projects.
#!/bin/sh
# To run, download the script or copy the code to a '.sh' file (for example 'fluttercleanrecursive.sh') and run like any other script:
# sh ./fluttercleanrecursive.sh
# or
# sudo sh fluttercleanrecursive.sh
echo "Flutter Clean Recursive (by jeroen-meijer on GitHub Gist)"
echo "Looking for projects... (may take a while)"
@lsiv568
lsiv568 / dropzone.coffee
Last active September 16, 2016 12:22
This directive uses the HTML5 drag and drop spec as well as the FileReader to base64 encode the dropped files. This allows for easy client/server transfer via REST protocol.
'use strict';
angular.module('reusableThings')
.directive('fileDropzone', () ->
restrict: 'A'
scope: {
file: '='
fileName: '='
}
link: (scope, element, attrs) ->
@guillaumepiot
guillaumepiot / gist:3939452
Created October 23, 2012 15:28
ANGULARJS - Django CSRF Token header setup
var myApp = angular.module('myApp').config(function($httpProvider) {
$httpProvider.defaults.headers.post['X-CSRFToken'] = $('input[name=csrfmiddlewaretoken]').val();
});