Skip to content

Instantly share code, notes, and snippets.

View joshuamabina's full-sized avatar
🎯
Focusing

Joshua Mabina joshuamabina

🎯
Focusing
View GitHub Profile
@bhaskarkc
bhaskarkc / extend.sh
Created December 20, 2019 21:14 — forked from wvengen/extend.sh
Extend non-HiDPI external display above HiDPI internal display
#!/bin/sh
# extend non-HiDPI external display on DP* above HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1`
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'`
@mjohnsullivan
mjohnsullivan / streams_with_async.dart
Created December 3, 2019 17:55
Example of how to transform streams of data in Dart/Flutter when the transform involves asynchronous calls.
import 'dart:async';
import 'dart:math' show Random;
final random = Random();
// Mock data for a list of messages
const messageList = [
{
'message': 'Message 1',
'timestamp': 1,
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active November 7, 2024 04:51
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@calebporzio
calebporzio / HiddenInput.vue
Created May 2, 2018 14:47
Little Vue component for turning JSON into native HTML for inputs
<script>
import _ from 'lodash'
export default {
props: [ 'name', 'value' ],
methods: {
flatInputsFromDeepJson(item, key, h) {
if (typeof item === 'object') {
return _.flatMapDeep(item, (value, newKey) => {
@connor11528
connor11528 / create_laravel_app.sh
Created July 11, 2017 21:09
Create a new Laravel application
#!/bin/bash
laravel new $1
cd $1
composer install
yarn install
touch README.md
cp .env.example .env
git init
git add -A
HTTPPort 8005
RTSPPort 8006
HTTPBindAddress SEU.IP.AQUI
RTSPBindAddress SEU.IP.AQUI
MaxClients 100
MaxBandwidth 10000
NoDefaults
<Feed webcam.ffm>
File /tmp/webcam.ffm
@goldhand
goldhand / :nth-child React Component Factory .js
Created June 9, 2016 19:56
Factory for creating React components with nth-child css selector like properties.
import React, {Component, PropTypes} from 'react';
/**
* createNthChild is a factory for NthChild components.
*
* Can set conditional styling meant to simulate css's nth-child pseudo selector
*
* @param {object} [options] - styles options to pass into the icon panel
* @param {function} [styleFirst] - if isFirst, invoke styleLast(options.styles)
@nebil
nebil / styleguide-en.md
Last active August 10, 2023 19:42
🎨 The opinionated Git styleguide — with emoji! 🎨

Git – styleguide

Rationale

_A styleguide is about consistency. Consistency with this styleguide is important. [...]
However, know when to be inconsistent -- sometimes the styleguide just doesn’t apply.
When in doubt, use your best judgment.

@srayhunter
srayhunter / android-update-commandline.md
Last active September 18, 2023 13:13
Android - Update Android SDK from the commandline

Android - Update Android SDK from the commandline

Update the installed packages

sdkmanager --update

List all items (--all is needed to show obsolete, build tools and other items)

sdkmanager --list
@SpartakusMd
SpartakusMd / vhost.sh
Last active January 23, 2017 11:18
VHost generator
#!/bin/bash
# Colors
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
undred='\e[4;31m' # Red
undgrn='\e[4;32m' # Green
undylw='\e[4;33m' # Yellow