Skip to content

Instantly share code, notes, and snippets.

View eightyfive's full-sized avatar

0x55 eightyfive

View GitHub Profile
@eightyfive
eightyfive / Lure.js
Last active November 5, 2020 15:02
Lure.js – Tiny Object-Oriented jQuery UI library
(function(root, $) {
var Lure = root.Lure = {};
// ALL credits goes to: backbone.js & marionette.js
Lure.$ = $;
var idCounter = 1;
@eightyfive
eightyfive / jquery.data-ajax.js
Last active February 15, 2017 09:32
jQuery [data-ajax] API
$(document).on('click', '[data-ajax]', function (ev) {
var $this = $(this)
var data = $this.data()
var redirect = $this.prop('href') || data.redirect
// `settings` must follows jQuery.ajax API
var settings = data.ajax
ev.preventDefault()
$.ajax(settings).done(function () {
@eightyfive
eightyfive / activity-indicator.js
Last active December 15, 2020 14:25
A collection of React Native atoms (atomic design)
import React from 'react';
import { ActivityIndicator as RNActivityIndicator } from 'react-native';
export default function ActivityIndicator({
color = 'white',
large = false,
...rest
}) {
const size = large ? 'large' : 'small';
import { Platform } from 'react-native';
import Env from '../env';
export default {
url: `${Env.APP_URL}/${Env.API_PREFIX}`,
options: {
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
@eightyfive
eightyfive / app\dial.scss
Last active January 25, 2021 16:01
Flexbox `dial` positioning system
// dial.css
[class^="col-"],
[class*=" col-"] {
display: flex;
flex-direction: column;
}
[class^="row-"],
[class*=" row-"] {
display: flex;
@eightyfive
eightyfive / resources\sass\_bulma.scss
Last active January 4, 2022 23:18
Laravel App SASS (Bulma)
// Utilities
@import "../../node_modules/bulma/sass/utilities/functions";
@import "../../node_modules/bulma/sass/utilities/derived-variables";
@import "../../node_modules/bulma/sass/utilities/mixins";
@import "../../node_modules/bulma/sass/utilities/controls";
// Base
@import "../../node_modules/bulma/sass/base/minireset";
@import "../../node_modules/bulma/sass/base/generic";
@eightyfive
eightyfive / app\View\Components\Bulma.php
Created November 22, 2020 21:21
Bulma Laravel Blade components
<?php
namespace App\View\Components;
use Illuminate\View\Component;
use Illuminate\View\ComponentAttributeBag;
use Illuminate\Support\HtmlString;
abstract class Bulma extends Component
{
@eightyfive
eightyfive / .env.patch
Last active November 22, 2020 22:43
Laravel 8 app boilerplate
@@ -7,9 +7,9 @@
LOG_CHANNEL=stack
LOG_LEVEL=debug
-DB_CONNECTION=mysql
+DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
-DB_PORT=3306
+DB_PORT=5432
DB_DATABASE=laravel
@eightyfive
eightyfive / spacing.js
Last active November 23, 2020 20:55
Simple react-native spacing strategy: `mb[3]`, `px[0]`, ...
import { StyleSheet } from 'react-native';
export const sizes = [0, 4, 8, 16, 32, 64, 128];
// https://stackoverflow.com/a/56219676/925307
const make = (key, sizes) => sizes.map((size) => ({ [key]: size }));
export const m = make('margin', sizes);
export const mt = make('marginTop', sizes);
export const mr = make('marginRight', sizes);
@eightyfive
eightyfive / README.md
Last active January 14, 2021 15:27
Android react-native-splash-screen setup

Steps

  1. $ yarn add react-native-splash-screen
  2. $ cd ios/ && pod install && cd ..
  3. $ npx yown @eightyfive/react-native-splash-screen
  4. Rename yourapp folder to your project name
  5. Rename package com.yourapp in Java files
  6. Create android/app/src/main/res/drawable-hdpi/logo.png file (1024x1024, transparent background)

Warning