Skip to content

Instantly share code, notes, and snippets.

View joaomarcos96's full-sized avatar

João Marcos joaomarcos96

View GitHub Profile
@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
@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
@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/>
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();
@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(
@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,
@Blasanka
Blasanka / flutter_gridview.dart
Last active June 2, 2022 05:10
Flutter Staggered GridView for flexible different height card or content instead gridview in flutter. Read my Stack Overflow answer here: https://stackoverflow.com/questions/49781657/adjust-gridview-child-height-according-to-the-dynamic-content-in-flutter/54059209#54059209
import 'package:flutter/material.dart';
//this is what you need to have for flexible grid
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
//below two imports for fetching data from somewhere on the internet
import 'dart:convert';
import 'package:http/http.dart' as http;
//boilerplate that you use everywhere
@sigu
sigu / ruby_install.sh
Created March 19, 2018 08:56
Installing ruby 2.3.1 using asdf on arch linux
#make sure rvm is installed then
rvm pkg install openssl
CC=gcc-6 RUBY_EXTRA_CONFIGURE_OPTIONS="--with-openssl-dir=$HOME/.rvm/usr" asdf install ruby 2.3.1
@skabber
skabber / exportOptions.plist
Last active April 14, 2024 20:47
Export Options Plist Example
<?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>app-store</string>
<key>teamID</key>
<string>XXXXXXXXXX</string>
<key>uploadBitcode</key>
<true/>
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active April 25, 2024 13:38
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages