Skip to content

Instantly share code, notes, and snippets.

@Whip
Whip / https-on-localhost.md
Last active April 24, 2024 03:24 — forked from adnan360/https-on-localhost.md
Use HTTPS on Localhost (XAMPP, Windows)

This has been tested with XAMPP (PHP 8.2) on Windows 11.

STEP 1: Editing Configs

Open php.ini by clicking Config button on the Xampp control panel

In this ini file semi colon (;) is used to comment a line. We want to use openssl library, so we have to make sure the line for openssl is not commented.

Remove semi colon (;) in front of this line, if there is any:

@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active April 24, 2024 03:22
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@adam-hanna
adam-hanna / systemd-cloudwatch-logs-tutorial.md
Last active April 24, 2024 03:22
Forward systemd service logs to AWS Cloudwatch

Introduction

I often find myself ssh'ing into my servers and checking my systemd service logs with $ journalctl -f -u {name}.service. One day I got tired of this and wanted all of my important logs in once place (Amazon AWS Cloudwatch). To my dismay, there weren't any real good tutorials on how to do so. So, voilà.

Steps

Overall, it's a fairly simple process consisting of the following few steps.

1. Modify the service file

Open the service file with $ sudo vi /lib/systemd/system/{name}.service

Modify the [Service] section:

@baobao
baobao / PooledDOTween.cs
Last active April 24, 2024 03:20
大量のオブジェクトを何度もTweenさせる場合はSetRecyclable(true)にした方がよいかもと検証したサンプルコード
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
public class PooledDOTween : MonoBehaviour
{
private List<GameObject> objs = new List<GameObject>();
/// <summary>
/// TweenerのPoolフラグ
@RizkyRajitha
RizkyRajitha / test.yml
Last active April 24, 2024 03:17
GitHub action workflow for test , using PostgreSQL database service container .
name: Running Tests
on: [push]
jobs:
Test:
runs-on: ubuntu-latest
services:
postgres:
@dmnsgn
dmnsgn / listAllEventListeners.js
Created April 5, 2017 15:40
List all event listeners in a document
const listeners = (function listAllEventListeners() {
let elements = [];
const allElements = document.querySelectorAll('*');
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
for (let i = 0; i < allElements.length; i++) {
const currentElement = allElements[i];
@JakubOboza
JakubOboza / private-docker-regs-with-free-tiers.markdown
Created May 30, 2019 07:15
Private Docker registry with free tiers for Developers.

List of sites with free tier limits

  • Docker Hub - One private repo/image spot for free
  • Three Scale - Very generous free tier 50GB of space, 500 Pulls a month etc..
  • Canister - 20 private repos with almost no limits on free tier
  • Code Fresh - Free tier for developers

Setup your own private registry

@donvito
donvito / main.go
Last active April 24, 2024 03:13
AES-256 encrypt/decrypt in Go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
)
@SantoshSrinivas79
SantoshSrinivas79 / Running electron using xvfb.md
Last active April 24, 2024 03:09
Running electron using xvfb

Running electron using xvfb

Install xvfb

apt-get install xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps

Some tips at: xvfb init script for Ubuntu

@ShimShamSam
ShimShamSam / stopSidewaysVelocity.js
Last active April 24, 2024 03:08
Phaser Physics - Stop sideways velocity
/**
* Negate sideways velocity on an object being acted upon by a Phaser physics engine.
* The primary use for this is to simulate vehicle movement by negating "drift" when the vehicle turns.
* @param {Phaser.Sprite} sprite The sprite whose sideways velocity you want to negate
*/
function stopSidewaysVelocity(sprite) {
// Recycle the same object to conserve memory
if(!stopSidewaysVelocity.sideways) {
stopSidewaysVelocity.sideways = {};
}