Skip to content

Instantly share code, notes, and snippets.

View dum3ng's full-sized avatar
🤔
re-thinking

dumeng dum3ng

🤔
re-thinking
View GitHub Profile
@dum3ng
dum3ng / unity
Created September 27, 2024 08:18
ignore
Library
library
Temp
temp
Obj
obj
Build
build
Builds
builds
@dum3ng
dum3ng / EventManager.cs
Last active April 8, 2023 08:49
EventManger unity
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
[Serializable]
class OneEvent : UnityEvent<EventPayload>
{
}
@dum3ng
dum3ng / multiple_ssh_setting.md
Created April 21, 2019 14:50 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@dum3ng
dum3ng / img.jsx
Last active June 8, 2018 02:44
react-image with `onLoad` and `onError` callback
/* the author of this component does not accept the proposal to use the `onLoad` and `onError` callback,
so make the change here.
https://github.com/mbrevda/react-image/blob/master/src/index.js
*/
import React, {Component} from 'react'
import {node, func, oneOfType, string, arrayOf, bool} from 'prop-types'
const cache = {}
class Img extends Component {
static propTypes = {
@dum3ng
dum3ng / mouse.js
Created December 29, 2017 02:24 — forked from electricg/mouse.js
Mouse position relative to document and element
// Which HTML element is the target of the event
function mouseTarget(e) {
var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
return targ;
}
@dum3ng
dum3ng / !re_natal.components.md
Last active February 11, 2017 08:48
Transform the react native components to reagent components.

for re-natal.

var fs = require('fs')
var path = require('path')
module.exports = {
entry: path.resolve(__dirname, 'server.js'),
output: {
filename: 'server.bundle.js'
},
@dum3ng
dum3ng / login.js
Created November 3, 2016 08:54
A xmlHttpRequest Post is type of :Content-Type: application/x-www-form-urlencoded; charset=UTF-8 This is a demo just use the cookie to memorize user's login state. Not for production environment. Use a session to add more security.
/*global $*/
var login = $('#login')
var input = $('#username')
login.on('click', function(e){
var username = input.val().trim()
$.post({
window.location,
{username},
@dum3ng
dum3ng / layout.pug
Created July 1, 2016 12:44
pug file of layout. bootstrap responsive header.
doctype html
html(lang='en')
head
block title
title home
body
// header
div.navbar.navbar-default.navbar-fixed-top
div.navbar-header
a.navbar-brand Brand
@dum3ng
dum3ng / .eslintrc.js
Last active June 28, 2016 13:05
eslint configuration, typescripte configuration in vscode
module.exports = {
"env": {
"browser": true,
"node": true
},
"extends": "eslint:recommended",
"installedESLint": true,
"parserOptions": {