Skip to content

Instantly share code, notes, and snippets.

View joaomarcos96's full-sized avatar

João Marcos joaomarcos96

View GitHub Profile
@slightfoot
slightfoot / always_scrollbar.dart
Created March 4, 2019 18:20
Always Visible Scrollbar for Flutter - 4th March 2019
import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primaryColor: Colors.indigo,
@mono0926
mono0926 / main_counter.dart
Created April 27, 2019 02:09
ValueNotifier/ValueListenableBuilderの最小構成のサンプル
import 'package:flutter/material.dart';
const title = 'ValueListenableBuilder Demo';
void main() => runApp(App());
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
import 'package:flutter/material.dart';
/// able to show scrollbar always with following example
/// available with changes from this branch https://github.com/onatcipli/flutter/tree/scrollbar_display_always
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
@lukaselmer
lukaselmer / ExportOptions.plist
Created January 11, 2020 21:10
Create a Flutter .apk and .ipa file to upload it to Firebase App Distribution
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>ad-hoc</string>
<key>uploadBitcode</key>
<false/>
<key>uploadSymbols</key>
<true/>
@serradura
serradura / observers.rb
Last active April 21, 2022 19:33
Simple observer (pub/sub) in Ruby
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'u-test'
gem 'activerecord', require: 'active_record'
gem 'sqlite3'
end
@ricsdeol
ricsdeol / resoursable.rb
Created October 1, 2020 01:14
Resoursable
# frozen_string_literal: true
module Resourceable
extend ActiveSupport::Concern
included do
before_action :set_resource, only: %i[show edit update destroy]
before_action :authorize_resource
helper_method :resource
@rponte
rponte / using-uuid-as-pk.md
Last active May 13, 2024 08:21
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

Installing Ruby 2.3.x in Arch Linux

Have openssl-1.0 and gcc installed

sudo pacman -S --needed openssl-1.0 gcc

Install Ruby 2.3.x with gcc and openssl path defined

@joaomarcos96
joaomarcos96 / ExportOptions.plist
Last active March 19, 2021 21:34
iOS automated deploy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>destination</key>
<string>upload</string>
<key>method</key>
<string>app-store</string>
<key>teamID</key>
<string>MyTeamID</string> <!-- your team ID, something like "AB12C345DE" -->
@joaomarcos96
joaomarcos96 / pre-push.sh
Last active February 8, 2021 13:10
git pre-push hook to confirm push force or delete on any branch
#!/bin/sh
current_branch=$(git rev-parse --abbrev-ref HEAD)
push_command=$(ps -ocommand= -p $PPID)
is_destructive='force|delete|\-f'
confirm_destructive_action(){
read -p 'Are you sure you want to push to "'$current_branch'" ? (y/n): ' -n 1 -r < /dev/tty