Skip to content

Instantly share code, notes, and snippets.

@tdomarkas
tdomarkas / riverpod_debug_observer.dart
Last active April 18, 2024 12:45
Riverpod debug observer
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:logging/logging.dart';
/// Usage:
///
/// ```dart
/// ProviderScope(
/// observers: kDebugMode ? [RiverpodDebugObserver()] : [],
/// child: MyApp(),
/// )
@tdomarkas
tdomarkas / Service.php
Last active July 11, 2021 11:59
HTTPlug client (with basic auth)
<?php
class Service
{
/** @var Psr\Http\Client\ClientInterface */
private $client;
/** @var Psr\Http\Message\RequestFactoryInterface */
private $requestFactory;
@tdomarkas
tdomarkas / hipslack.js
Created February 13, 2019 19:06
HipChat-like theme for Slack
// ==UserScript==
// @name HipSlack
// @namespace http://domarkas.lt/
// @version 0.1
// @description HipChat-like theme for Slack
// @author Tadas Domarkas
// @match https://*.slack.com/*
// @grant none
// ==/UserScript==
@tdomarkas
tdomarkas / repo-rinse.sh
Created October 12, 2018 14:04 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@tdomarkas
tdomarkas / install_php71_opensuse.sh
Created April 26, 2017 17:39 — forked from jniltinho/install_php71_opensuse.sh
Install PHP 7.1 on OpenSUSE
#!/bin/bash
### Install PHP 7.1 on OPenSUSE 42.2 64Bits
### https://build.opensuse.org/package/view_file/devel:languages:php/php7/php7.spec?expand=1
### https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/
### http://www.shaunfreeman.name/compiling-php-7-on-centos/
zypper in openssl-devel
zypper in gcc gcc-c++ libxml2-devel pkgconfig libbz2-devel curl-devel libwebp-devel
@tdomarkas
tdomarkas / interrupt_query.sql
Created December 11, 2015 10:34
Interrupts a MySQL query
DELIMITER $$
CREATE FUNCTION InterruptQuery(connection_id INT) RETURNS INT DETERMINISTIC
BEGIN
KILL QUERY connection_id;
RETURN 0;
END
$$
SELECT InterruptQuery(CONNECTION_ID()) $$
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default

uuid

uuid is a PHP module for generating UUIDs. It can be installed from PECL with the following command:

sudo pecl install uuid

Functions

@tdomarkas
tdomarkas / Gulpfile.js
Last active August 29, 2015 14:13
Gulpfile boilerplate
var gulp = require('gulp'),
concat = require('gulp-concat'),
less = require('gulp-less'),
uglify = require('gulp-uglify');
var files = {
copyCss: [
'bower_components/animate.css/animate.min.css',
'bower_components/suit-components-arrange/lib/arrange.css'
],