Skip to content

Instantly share code, notes, and snippets.

View bymaximus's full-sized avatar

bymaximus

  • Seeking new dragons
  • Brazil, Cataguases / MG
View GitHub Profile
@mashhoodr
mashhoodr / cloudflare_worker_proxy.js
Last active October 10, 2022 16:01
A simple proxy pass script for Cloudflare Worker which handles the basic cases
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* Respond to the request
* adapted from https://github.com/xiaoyang-liu-cs/workers-proxy
* @param {Request} request
*/
async function handleRequest(request) {
@anilahir
anilahir / sql.md
Created December 20, 2019 08:14
MySQL transaction within stored procedure example

Create stored procedure :

DROP PROCEDURE IF EXISTS sp_delete_users_till_date;

DELIMITER //

CREATE PROCEDURE sp_delete_users_till_date(location_id INT, till_date DATE)
@jkga
jkga / app-style.js
Created June 21, 2018 15:52
Adding style inside Vue components' template without using vue-loader
// app-style.js
// adding <style></style> directly inside template will result in error or empty element which
// this component is trying to address
// this will allow you to dynamically insert css inside Vue template without the use of vue loader
// or if you do not want to use .vue extension at all
// however it doesnt really apply scope css (for now).
export default {
name: 'app-style',
data: function(){
return {
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active August 20, 2024 19:19
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

notice: Wii U linux is not production ready! Proceed at your own risk. Written on 2/3/18

Quarktheawesome and rw-r-r_0644 have released an early version of Linux for Wii U!

Source code

The PowerPC side of the Wii U requires a custom linux kernel, which can be found here. The ARM side of the Wii U requires a custom fw.img file to load that kernel, which can be found here.

Once the kernel is up and running, the first repo is configured to automatically try to load programs from /dev/sda1 in an inserted usb. The first partition of an ext4 USB stick should contain a root filesystem for a linux distribution. See here for more information on a prebuilt PowerPC image

Notice

@gskema
gskema / color-gradient.js
Last active March 2, 2024 22:14
Generate gradient color from 2 or 3 colors using JavaScript. Example: https://jsfiddle.net/e18g5f3L/
/**
* You may use this function with both 2 or 3 interval colors for your gradient.
* For example, you want to have a gradient between Bootstrap's danger-warning-success colors.
*/
function colorGradient(fadeFraction, rgbColor1, rgbColor2, rgbColor3) {
var color1 = rgbColor1;
var color2 = rgbColor2;
var fade = fadeFraction;
// Do we have 3 colors for the gradient? Need to adjust the params.
@bjorn-ali-goransson
bjorn-ali-goransson / AwsAuthenticator.cs
Created May 4, 2016 17:20
Authenticate to AWS with RestSharp (nicked from minio-dotnet / V4Authenticator with minor modifications)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
namespace Rest.Authentication
{
public class AwsAuthenticator : RestSharp.Authenticators.IAuthenticator
{
public string AccessKeyId { get; }
@ksingh7
ksingh7 / enable-root-login-cloud-init
Created April 16, 2016 20:55
enable root login from cloud-init
$ sudo perl -i -pe 's/disable_root: 1/disable_root: 0/' /etc/cloud/cloud.cfg
$ sudo perl -i -pe 's/#PermitRootLogin .*/PermitRootLogin without-password/' /etc/ssh/sshd_config
$ sudo perl -i -pe 's/.*(ssh-rsa .*)/\1/' /root/.ssh/authorized_keys
$ sudo /etc/init.d/sshd reload # optional command
@mfurlend
mfurlend / composer.json
Last active April 18, 2024 21:41
composer require git repository
{
"name": "my_vendor_name/my_package",
"description": "My Package Description",
"license": "GPL-3.0",
"autoload": {
"classmap": [ // search these directories for classes
"lib/"
]
},
"repositories": {
@leftclickben
leftclickben / gist:322b7a3042cbe97ed2af
Last active June 7, 2023 10:58
Steps to migrate from SVN to GitLab

Steps to migrate from SVN to GitLab

This process worked for me. I take no responsibility for any damage or loss incurred as a result of following or not following these steps or, for that matter, anything else you might do or not do.

Setup

  • SVN is hosted at svn.domain.com.au.
  • SVN is accessible via http (other protocols should work).
  • GitLab is hosted at git.domain.com.au and: