Skip to content

Instantly share code, notes, and snippets.

View RadianSmile's full-sized avatar

Radian RadianSmile

  • Provision Co., Ltd
  • Taipei, Taiwan
  • 05:18 (UTC +08:00)
View GitHub Profile
@Erefor
Erefor / component.vue
Created August 14, 2022 02:20
Vue 3 / Options Api Detect outside click
<template>
<div
ref="componentRef"
class="general-style"
>
</div>
</template>
<script>
import useDetectOutsideClick from '/useDetectOutsideClick'
@randhirraj3130
randhirraj3130 / ValidateEmail.cs
Created August 2, 2017 07:09
how to validate email in unity c#
step 1-import the following
using System.Text.RegularExpressions;
step 2- define
public const string MatchEmailPattern =
@"^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@"
+ @"((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\."
+ @"([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|"
+ @"([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$";
step 3-call the following function
@RadianSmile
RadianSmile / HTML 5 Microphone Visualizer.markdown
Created January 6, 2016 15:59
HTML 5 Microphone Visualizer
@pa4373
pa4373 / ptt-crawler.js
Last active April 30, 2016 16:27
ptt-crawler
// npm i request cheerio json2csv
var fs = require('fs'),
request = require('request'),
cheerio = require('cheerio'),
json2csv = require('json2csv');
var HOST = 'https://www.ptt.cc';
var getMenu = function (url, callback, links) {
var links = links || []; // Set default value for links (initial call)
@andrealbinop
andrealbinop / setup-modernie-vagrant-boxes.md
Last active May 28, 2023 01:54
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@iandol
iandol / ptbkernel.sh
Created October 22, 2014 02:42
You'll need to update the path on line 9 to your PTB installation...
#!/bin/zsh
sudo cd /System/Library/Extensions
echo "\n\nIs PsychtoolboxKernelDriver Currently Installed"
kextstat -b PsychtoolboxKernelDriver
echo "\n\nRemoving old driver, installing update..."
sudo kextunload -b PsychtoolboxKernelDriver
sudo rm -rf PsychtoolboxKernelDriver.kext
sudo unzip ~/Code/Psychtoolbox-3/Psychtoolbox/PsychHardware/PsychtoolboxKernelDriver64Bit.kext.zip
@rubo77
rubo77 / config
Created August 14, 2014 05:49
~/.ssh/config example with selected identity file for a certain server
Host example.org
IdentityFile ~/.ssh/id_rsa
Host *
ForwardAgent no
IdentitiesOnly yes
@jonathantneal
jonathantneal / README.md
Last active March 19, 2024 23:31
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@mwhite
mwhite / git-aliases.md
Last active July 18, 2024 03:14
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@kuhnza
kuhnza / http-request-dumper.js
Last active May 25, 2024 05:01
A simple node server that dumps raw incoming http requests out to the command line.
var http = require('http');
var LISTEN_ON_PORT = 3000;
function toTitleCase(str) {
return str.replace(/[a-z]*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}
http.createServer(function (req, res) {
var body;