Skip to content

Instantly share code, notes, and snippets.

View gmaggio's full-sized avatar

Giraldi Maggio gmaggio

View GitHub Profile
@Barttje
Barttje / rotating-arcs.dart
Last active January 16, 2023 11:02
Rotating arcs with a GestureDetector and CustomPainter
import 'package:flutter/material.dart';
import 'dart:math' as math;
void main() {
runApp(const ExampleApp());
}
class ExampleApp extends StatelessWidget {
const ExampleApp({Key? key}) : super(key: key);
@SuppieRK
SuppieRK / CaseMatcher.kt
Last active May 2, 2024 22:41
Regular expressions for case matching
/**
* Different case matchers
*
* @see <a href="https://en.wikipedia.org/wiki/Naming_convention_(programming)#Examples_of_multiple-word_identifier_formats">Examples of multiple word identifier formats</
*/
sealed class CaseMatcher(private val regex: Regex) {
open fun notMatches(source: String?): Boolean {
return !matches(source)
}
@urbanhusky
urbanhusky / userChrome.css
Last active July 14, 2022 15:23
Firefox 95 ultra-compact multirow tabs on top, context line below tab & compact menus - urbanhusky's ugly hack YMMV :)
/* Hi, urbanhusky here.
This is cobbled together from various sources.
One of those sources is: https://github.com/MrOtherGuy/firefox-csshacks
*/
/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/multi-row_tabs.css made available under Mozilla Public License v. 2.0
See the above repository for updates as well as full license text. */
/* Makes tabs to appear on multiple lines */
/* Tab reordering will not work and can't be made to work */

Using JSDOC-Based TypeScript

Get Started

Choose your editor

  • WebStorm, Rider
    • Partial support, not enough intelli hints
    • Toggle on TypeScript language service
  • VSCode
@evelyne24
evelyne24 / scrollable_footer.dart
Created April 7, 2019 21:06
Flutter scrollable footer - a footer that stays at the bottom of the screen and scrolls with its container; also see https://docs.flutter.dev/flutter/widgets/SingleChildScrollView-class.html
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'dart:math' as math;
class CustomLayout extends MultiChildRenderObjectWidget {
CustomLayout({
Key key,
List<Widget> children = const <Widget>[],
}) : super(key: key, children: children);
@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.
@gmaggio
gmaggio / wp-page-subpage-menu.php
Created July 25, 2014 01:58
[Wordpress] Display Child Pages on the Parent Page (including the Parent Page itself)
<?php
/**
* Display Child Pages on the Parent Page
* (including the Parent Page itself)
*
* Sources:
* - http://codex.wordpress.org/Function_Reference/wp_list_pages
* - http://www.wpbeginner.com/wp-tutorials/how-to-display-a-list-of-child-pages-for-a-parent-page-in-wordpress/
* - http://www.svennerberg.com/2009/02/creating-a-submenu-in-wordpress/
*/
@gmaggio
gmaggio / jquery-row-height-equal.js
Created July 19, 2014 19:38
[jQuery] Equal Height Rows - Responsive
/**
* Equal Height Rows - Responsive
*
* Source:
* http://codepen.io/micahgodbolt/pen/FgqLc?editors=101
* http://css-tricks.com/equal-height-blocks-in-rows/
*
*/
equalheight = function(container){
@gmaggio
gmaggio / wp-navmenu-insert-item.php
Created July 9, 2014 21:39
[Wordpress] Insert custom menu items via hard coding
<?php
// Sample: Add HOME link to Nav Menu
function new_nav_menu_items($items, $args) {
if( $args->theme_location == 'primary' ){
$homelink = '<li class="home"><a href="' . home_url( '/' ) . '">' . __('Home') . '</a></li>';
$items = $homelink . $items;
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'new_nav_menu_items', 10, 2 );