Skip to content

Instantly share code, notes, and snippets.

@kherel
kherel / distortion.dart
Created June 2, 2021 06:28 — forked from wilsonowilson/distortion.dart
Widget warping and distortion in Flutter
import 'dart:typed_data';
import 'dart:ui' hide Image;
import 'package:image/image.dart' as img_lib;
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
enum ImageFetchState { initial, fetching, fetched }
class ImagePlayground extends StatefulWidget {
@kherel
kherel / bubble_effect.dart
Created June 2, 2021 06:27 — forked from slightfoot/bubble_effect.dart
3D Style Bubble Magnifying Effect - by Simon Lightfoot and Wilson Wilson @wilsonowilson - 18/03/2021
// MIT License
//
// Copyright (c) 2021 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';
import 'dart:convert';
/*
* TextView with HTML tags support By Kyle Katarn for Dart
*
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
* and ported it on JavaScript by John Resig (ejohn.org)
@kherel
kherel / page_turn.dart
Created September 10, 2019 06:38 — forked from slightfoot/page_turn.dart
Page Turn Effect - By Simon Lightfoot. Replicating this behaviour. https://www.youtube.com/watch?v=JqvtZwIJMLo
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@kherel
kherel / monit.rc
Created March 14, 2016 11:42 — forked from vkurennov/monit.rc
Пример конфига для запуска процессов через monit
### Nginx ###
check process nginx with pidfile /opt/nginx/logs/nginx.pid
start program = "/etc/init.d/nginx start"
stop program = "/etc/init.d/nginx stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if memory usage > 80% for 5 cycles then restart
if failed host 127.0.0.1 port 80 protocol http
then restart
if 3 restarts within 5 cycles then timeout
@kherel
kherel / production.rb
Created March 14, 2016 04:41 — forked from vkurennov/production.rb
Пример конфига unicorn
# paths
app_path = "/home/deployer/qna"
working_directory "#{app_path}/current"
pid "#{app_path}/current/tmp/pids/unicorn.pid"
# listen
listen "/tmp/unicorn.qna.sock", :backlog => 64
# logging
stderr_path "log/unicorn.stderr.log"