Skip to content

Instantly share code, notes, and snippets.

View keidarcy's full-sized avatar
🧙‍♂️
making something

Xing Yahao keidarcy

🧙‍♂️
making something
View GitHub Profile
@keidarcy
keidarcy / 1_simple.go
Created January 1, 2023 11:06 — forked from sosedoff/1_simple.go
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@keidarcy
keidarcy / node.js
Created March 17, 2022 02:18 — forked from Roman2K/node.js
Ruby/node encryption/decryption
const crypto = require('crypto');
const PASSWORD = "098f6bcd4621d373cade4e832627b4f6"
, MESSAGE = 'test';
function InvalidSignatureError() {
Error.captureStackTrace(this, this.constructor);
}
function encipher(message, password, callback) {
@keidarcy
keidarcy / css-selectors.md
Created July 8, 2020 02:18 — forked from magicznyleszek/css-selectors.md
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Element selectors

Element -- selects all h2 elements on the page

h2 {
    foo: bar;
@keidarcy
keidarcy / Cors.php
Created June 29, 2020 02:33 — forked from drewjoh/Cors.php
Laravel CORS Middleware
<?php // /app/Http/Middleware/Cors.php
namespace App\Http\Middleware;
use Closure;
class Cors {
public function handle($request, Closure $next)
{
return $next($request)
@keidarcy
keidarcy / watch_video.js
Created June 21, 2020 03:31 — forked from kushalvyas/watch_video.js
JS for Camera capture from browser
/**
* Created by kushal
*
* Usage :
* To access local system webcam on the internet/
* Couple of points to be remembered:
*
* - Accessing the webcam using HTML5 and JS requires permission from
* the browser. The url of the file has to be a valid one. Url such as file:/// in your browser will not permit the browser to access local webcam.
* - Whereas, an http or https url will surely make a paved way for it. Hence, while developing, one can use Xampp, Wamp or the LAMP Stack.