Skip to content

Instantly share code, notes, and snippets.

View ariona's full-sized avatar
🏠
Working from home

Rian Ariona ariona

🏠
Working from home
View GitHub Profile
@danielcshn
danielcshn / fix-duplicate-class-android-studio.md
Created April 16, 2023 04:08
Fix Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-* Android Studio | 2022.2.1

📜 Info:

  • Android Studio Flamingo | 2022.2.1
  • Build #AI-222.4459.24.2221.9862592, built on March 31, 2023
  • Gradle JDK: jbr-17 (JetBrains Runtime version 17.0.6)
  • Windows 11 (version 10.0.22000.1817)

🐛 Bug/Error log:

@whiplashoo
whiplashoo / hexOrRGBToColor.dart
Created April 23, 2021 08:23
Convert a hex, rgba, or rgb color string to Color object in Dart
import 'dart:ui';
import 'package:flutter/material.dart';
// Converts a hex, rgb, or rgba color string to Color object. Works with opacity values as well.
// e.g.:
// "#000" -> Color(0xff000000)
// "#cc3333" -> Color(0xffcc3333)
// "#cc3333dd" -> Color(0xddcc3333)
// "rgb(204, 44, 81)" -> Color(0xffcc2c51)
// "rgba(204, 44, 81, 0.20)" -> Color(0x33cc2c51)
//plugins/axios.js
export default function ({ $axios, app }) {
$axios.onError(error => {
const code = parseInt(error.response && error.response.status)
if ([401, 403].includes(code)) {
app.$auth.logout();
}
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
@mariusgnicula
mariusgnicula / gist:2261bb9548ef1a5388704bf0ef02528b
Created October 11, 2017 07:33
How to include JS into custom Elementor Widget
Include your JS into a normal file, just how you are used to and enqueue it with wp_enqueue_script. This will not work in the editor, because you want the functions to fire when you add them.
At the beginning of your widget file, add ‘use Elementor\Plugin;’.
Then at the end of the render() function in your PHP, add this:
<?php if ( Plugin::$instance->editor->is_edit_mode() ) : ?>
<script>Your code here</script
<?php
@christopher4lis
christopher4lis / util-elastic-collision.js
Last active April 23, 2024 15:40
A set of utility functions used to reproduce the effect of elastic collision within HTML5 canvas. Used in the Chris Courses tutorial video on collision detection: https://www.youtube.com/watch?v=789weryntzM
/**
* Rotates coordinate system for velocities
*
* Takes velocities and alters them as if the coordinate system they're on was rotated
*
* @param Object | velocity | The velocity of an individual particle
* @param Float | angle | The angle of collision between two objects in radians
* @return Object | The altered x and y velocities after the coordinate system has been rotated
*/
@siswadi
siswadi / Waktu Sholat Arah Kiblat.md
Last active October 28, 2023 07:10
Waktu Sholat & Arah Kiblat w/ HTTP/JSON API

Waktu Sholat & Arah Kiblat

Informasi Waktu

https://time.sis.im/
https://time.sis.im/Asia/Jakarta
https://time.sis.im/help
https://time.sis.im/?help
https://time.sis.im/?timezone=Asia/Jakarta # rekomendasi
@overclokk
overclokk / nav-menu-exporter-importer.php
Last active January 17, 2019 10:45 — forked from raynov/nav-menu-exporter-importer.php
[WordPress Plugin] Nav Menu Exporter and Importer / Export and Import nav menus. Requires WordPress Importer plugin. Tested up to 4.7 - It works with, taxonomies, post_type and custom items.
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
@mul14
mul14 / 00_etc-hosts.md
Last active April 2, 2024 06:39
/etc/hosts for Vimeo, Reddit, Imgur, GitHub, DigitalOcean, dll

Unblock Steam, Vimeo, Reddit, Imgur, GitHub, DigitalOcean, NPM, PayPal, dll

Saya support Internet Positif untuk memblokir porn, situs judi, dan hal-hal ilegal lainnya. Tapi pemerintah dan ISP sangat konyol karena tidak mengizinkan akses ke Vimeo, Reddit, Imgur, Netflix--yang mana bukanlah situs dengan konten utama ilegal.

Linux / BSD / macOS

Tambahkan list di bawah ke /etc/hosts.

Windows

@magicznyleszek
magicznyleszek / multiply-blending-mode-to-png.md
Created August 20, 2014 11:27
Multiply blending mode to PNG in Photoshop
  1. copy your image (Ctrl+A and Ctrl+C)
  2. make a new document-sized pure-black layer behind it
  3. group the black layer and yor image together
  4. add mask to the group
  5. enter mask edit mode (alt+click on the mask icon/thumbnail)
  6. paste your image in the mask (b/w) and then invert it.
  7. save it as a 24-bit transparent PNG