Skip to content

Instantly share code, notes, and snippets.

View johannesjo's full-sized avatar
🌈
bam boom bamdadam

Johannes Millan johannesjo

🌈
bam boom bamdadam
View GitHub Profile
@vijay-prema
vijay-prema / ubuntu-on-asus-g14.md
Last active May 2, 2024 12:21
Ubuntu on Asus ROG Zephyrus G14 2021

Ubuntu on Asus ROG Zephyrus G14 2021 (Setup guide)

Here is a way to do a robust install of Ubuntu (+ optional Windows 11 dual boot and LUKS encryption) on an Asus laptop, with minimal usable hardware support, without a significant amount of tinkering that may break in future or require frequent technical attention.

In summary, the key thing is to have an up to date kernel, which usually means disabling secure-boot and installing the latest stable (6.0+) using mainline or xanmod, and as well as making sure the latest nvidia driver and dkms is installed.

Specs:

  • Model Asus G14 2021 (GA401QC)
  • AMD R7 5800 8 core 16 thread (onboard Radeon graphics)
  • NVIDIA RTX 3050 4GB (60W +15W boost)
@aneudysamparo
aneudysamparo / Deploy NestJS (Node-Express) on Plesk
Created April 2, 2020 22:18
How to deploy a NestJS app on Plesk
-Copy files to web directory ex: app.js and folders
-copy packages.json to webdirectory
-npm install
-change permision to all files and folders to only owner read
pase this on top of your app.js file
if (typeof(PhusionPassenger) !== 'undefined') {
PhusionPassenger.configure({ autoInstall: false });
}
@ayakix
ayakix / emu.md
Created December 17, 2019 13:54
How to update Chrome browser on Android emulator

Delete default Chrome

adb root
adb remount
adb shell
cd /system/app
rm Chrome -f -rR
cd /data/data
rm -r com.android.chrome
@shprink
shprink / _mixin.scss
Created October 16, 2018 17:32
Angular Material Sass to CSS variables
@function mat-color($palette-primary, $hue: default, $opacity: null) {
@if type-of($hue) == number and $hue >= 0 and $hue <= 1 {
@return mat-color($palette-primary, default, $hue);
}
$color: map-get($palette-primary, $hue);
$opacity: if($opacity == null, opacity($color), $opacity);
@if type-of($opacity) == string {
$new-string: str-replace($color, ')', '-alpha, 1)');
@jarek-foksa
jarek-foksa / index.html
Last active July 7, 2020 13:42 — forked from SMotaal/README.md
Electron 2.x demo app that demonstrates how to enable ES modules support.
<!DOCTYPE html>
<html>
<head>
<base href="app://./" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' app:; object-src 'self' app:;">
<script type="module" src="./module.js"></script>
</head>
<body>
Check the console!
@SMotaal
SMotaal / README.md
Last active January 13, 2023 20:07
Loading ES Modules in Electron 2.0.0 using Protocol

Now that Electron has hit Chrome's 60s we can have proper module support. But of course, the standard (for very good reasons) prevents loading modules from file: and it makes sense for both Electron and NW.js to adhere to the statusquo.

So if you were really excited and this bums you, don't worry, you are in for awesome things.

The future Electron eco-system offers two options for native ES modules:

  1. Custom Electron protocol via Chromium's module loading subsystem

  2. Custom NodeJS loaders via Node's module loading subsystem recommended

@dicer
dicer / wifionice
Last active April 26, 2024 20:25 — forked from vollkorn1982/wifionice
HowTo auto connect your Linux to the German Wifi on ICE trains
#!/bin/bash
# change the next line to match your wifi device and put this file in /etc/NetworkManager/dispatcher.d/ and make it executable
WIFI_DEVICE=wlp3s0
IF=$1
STATUS=$2
@dobrowins
dobrowins / AndroidManifest.xml
Created February 7, 2018 08:14
Detecting foreground activity from service
<application>
<service
android:label="BLABLABLA"
android:name=".service.WindowChangeDetectingService"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService"/>
</intent-filter>
<meta-data
android:name="android.accessibilityservice"
@ThomasBurleson
ThomasBurleson / tickets.facade.md
Last active February 22, 2024 07:41
Using ngrx with Effects + Facades

NgRx State Management with TicketFacade

Facades are a programming pattern in which a simpler public interface is provided to mask a composition of internal, more-complex, component usages.

When writing a lot of NgRx code - as many enterprises do - developers quickly accumulate large collections of actions and selectors classes. These classes are used to dispatch and query [respectively] the NgRx Store.

Using a Facade - to wrap and blackbox NgRx - simplifies accessing and modifying your NgRx state by masking internal all interactions with the Store, actions, reducers, selectors, and effects.

For more introduction, see Better State Management with Ngrx Facades

@philmerrell
philmerrell / audio.service.ts
Created November 20, 2017 21:10
Angular audio service class
import { Injectable } from '@angular/core';
import { Observable, BehaviorSubject } from 'rxjs/Rx';
@Injectable()
export class AudioService {
public audio: HTMLAudioElement;
public timeElapsed: BehaviorSubject<string> = new BehaviorSubject('00:00');
public timeRemaining: BehaviorSubject<string> = new BehaviorSubject('-00:00');
public percentElapsed: BehaviorSubject<number> = new BehaviorSubject(0);