Skip to content

Instantly share code, notes, and snippets.

View Rndwiga's full-sized avatar
😀
It's never that serious

Raphael Ndwiga Rndwiga

😀
It's never that serious
View GitHub Profile
@Rndwiga
Rndwiga / NGINX Virtual file for dynamic subdomain routing.txt
Created March 14, 2022 09:32
NGINX Virtual file for dynamic subdomain routing
server {
server_name tyondo.lan;
root /var/www/apps/tyondo/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
@Rndwiga
Rndwiga / .txt
Last active August 24, 2022 20:24
How to wildcard development server with DNSMasq Ubuntu
1. Install DNSMasq
>> apt install dnsmasq
2. Update the "/etc/dnsmasq.conf" file
----
listen-address=127.0.0.2
bind-interfaces
address=/tyondo.lan/127.0.0.1
address=/cirembo.lan/127.0.0.1
no-resolv
---------HTML-----------
<div id="image-preview">
<label for="image-upload" class="form-label" id="image-label">Choose File</label>
<input type="file" class="form-control" accept="image/png, image/jpeg" name="image" id="image-upload" />
</div>
------------END HTML---------
---------JS--------------
$.ajax({
url: "{{asset('assets/images/avtar/3.jpg')}}",
@Rndwiga
Rndwiga / youtube_download.py
Created September 27, 2019 11:40
I am one of those lazy people around. I had a couple of tracks from youtube that i wanted to download automatically. So, this is what i came up with...NOTE:: it rides on the youtube-dl utility
import os
musicList =[
"https://www.youtube.com/watch?v=KI5DdxYeIWk",
"https://www.youtube.com/watch?v=Id5XOZf6txg",
"https://www.youtube.com/watch?v=bOwuUbBE-Rw",
"https://www.youtube.com/watch?v=l_x2d23b_M8",
"https://www.youtube.com/watch?v=EdvdDPQEp5k",
"https://www.youtube.com/watch?v=FYpjjgRiaq0",
"https://www.youtube.com/watch?v=r14_4fPliTk",
@Rndwiga
Rndwiga / browser.html
Created February 20, 2018 19:31 — forked from stajnert/browser.html
Javascript to find browser version, os version and os bit version
<html>
<body>
<script type="text/javascript">
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
@Rndwiga
Rndwiga / gist:49cc94b5c57bf4b8d00902d1658d11a8
Created June 20, 2017 16:57 — forked from jineeshjohn/gist:2044414
Dynamic html table rows and column creation with jQuery
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<style>
table{
width:500px;
height:500px;
}
table td{
padding:10px;
margin:10px;
border:1px solid #ccc;
@Rndwiga
Rndwiga / PageController.php
Created March 22, 2017 11:30 — forked from marktopper/PageController.php
[Voyager] Routes for Pages BREAD
<?php
class PageController extends \App\Http\Controllers\Controller
{
public function show()
{
$slug = request()->segment(1);
$page = \TCG\Voyager\Models\Page::where('slug', $slug)
->firstOrFail();