Skip to content

Instantly share code, notes, and snippets.

View 3m1n3nc3's full-sized avatar
😜
Not hearing word

Legacy 3m1n3nc3

😜
Not hearing word
View GitHub Profile
@3m1n3nc3
3m1n3nc3 / ci_pre_xcodebuild.sh
Last active April 26, 2024 08:24
Installs node, Quasar and build your project in preparation for Xcode Cloud *Workflow*
#!/bin/bash
# ci_post_clone.sh
# App
#
# Created by xXx on 26/04/2024.
#
get_abs_filename() {
# $1 : relative filename
@3m1n3nc3
3m1n3nc3 / Creditcard.md
Last active March 22, 2024 04:17
Creditcard SVG

Add the flipped class name to the creditcard class div to flip the card

<html>
  <head>
    <link rel="preconnect" href="https://fonts.bunny.net">
    <link href="https://fonts.bunny.net/css?family=rock-salt:400" rel="stylesheet" />
    <style>
      .bodyTag {
        margin: 0;
@3m1n3nc3
3m1n3nc3 / README.md
Created July 30, 2023 15:01
SPA hosting tip on Nginx

When hosting an spa on Ngix we often run across one simple bug that keeps our pages out of reach when not accessed from a link on the landing page. And example scenario would be when navigating directly to https://spa-app.com/login without accessing the landing page, we are greated by a 404 Not found error even though we are certain that our content exists.

A rather simple solution to this would be adding the following line before the end of our Nginx Vhost configuration:

server {
  ...
  try_files $uri  $uri/ /index.html;
}
@3m1n3nc3
3m1n3nc3 / gtbr.js
Last active March 22, 2024 06:02
Remove google translate branding
addEventListener("DOMContentLoaded", (event) => {
const rmIt = setInterval(function() {
if (rmGTB()) clearInterval(rmIt)
}, 100)
});
function rmGTB() {
const gadg = document.querySelector('.goog-te-gadget')
if (gadg) {
const el = gadg.childNodes[0];
@3m1n3nc3
3m1n3nc3 / permissions.php
Created July 12, 2023 10:43
Recursively change file and directory permissions with php
<?
header('Content-Type: text/plain');
/**
* Changes permissions on files and directories within $dir and dives recursively
* into found subdirectories.
*/
function chmod_r($dir, $dirPermissions, $filePermissions) {
$dp = opendir($dir);
# 3m1n3nc3 ffmpeg_installer.sh to run all commands:
#root@cloudpanel:~# nano ffmpeg_installer.sh
#root@cloudpanel:~# chmod +x ffmpeg_installer.sh
#root@cloudpanel:~# ./ffmpeg_installer.sh
apt-get update
apt-get -y install autoconf automake cmake tclsh build-essential pkg-config git-core libssl-dev \
libvorbis-dev libx265-dev libx264-dev libass-dev libgpac-dev libsdl1.2-dev libtheora-dev \
libtool libvdpau-dev libfontconfig-dev libfreetype-dev libssh-dev libaom-dev
mkdir ~/ffmpeg_sources
@3m1n3nc3
3m1n3nc3 / PaystackHandler.vue
Last active April 19, 2023 06:16
An elegant VUE/Quasar component to handle all paystack payment initialization and verification. This gist is a custom solution built originally for use in the Quasar framework, you can customize and use for other vue projects as well.
<template>
<q-btn @click="initializeNewPayment()" v-if="!hidden">
<q-tooltip v-if="tooltip">
<q-icon v-if="tooltipIcon" :name="tooltipIcon" /> {{ tooltip }}
</q-tooltip>
</q-btn>
</template>
<script>
import { QSpinnerPuff } from "quasar";
@3m1n3nc3
3m1n3nc3 / nginx.conf
Created January 27, 2023 02:00
Hidding .php and .html file extension from URL on Nginx
location / {
try_files $uri $uri.html $uri/ @extensionless-php;
index index.html index.htm index.php;
}
location ~ \.php$ {
try_files $uri =404;
}
location @extensionless-php {
@3m1n3nc3
3m1n3nc3 / BlobImage.vue
Created August 31, 2022 03:28 — forked from nebaughman/BlobImage.vue
Load image with ajax (axios) as blob data in Vue component
<template>
<img ref="image" :src="blobUrl" @load="loaded"/>
</template>
<script>
import axios from "axios"
/**
* Load an image url as a blob
*/
@3m1n3nc3
3m1n3nc3 / .htaccess
Last active July 24, 2022 15:19
Perfect .htaccess file for SPA hosting on Apache servers
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
</IfModule>