Skip to content

Instantly share code, notes, and snippets.

View matrixcloud's full-sized avatar
🧑‍💻
Fighting

atom matrixcloud

🧑‍💻
Fighting
View GitHub Profile
@matrixcloud
matrixcloud / ViewMapper
Created April 17, 2017 00:19
c# singlton
public class ViewMapper<T> where T: BaseView {
private static T _ins;
public static T Instance {
get { return _ins; }
set {
if (_ins != null) {
GameObject.DestroyImmediate(_ins.gameObject);
}
_ins = value;
@matrixcloud
matrixcloud / .editorconfig
Last active March 17, 2018 01:16
.editorconfig
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
const path = require('path')
module.exports = {
entry: './src/main.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, '../static')
},
devtool: 'inline-source-map',
module: {
/*
* Copyright (C) 2017 Shanghai YongXiao Intelligence Co., Ltd.
*/
import React from 'react'
import ReactDOM from 'react-dom'
import { createStore, combineReducers, applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import { ConnectedRouter, routerReducer, routerMiddleware } from 'react-router-redux'
import { createEpicMiddleware } from 'redux-observable'
@matrixcloud
matrixcloud / maven.rt.xml
Created June 15, 2018 03:43
com.sun.xml.internal.bind.marshaller does not exist
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArguments>
<bootclasspath>${JAVA_HOME}/jre/lib/rt.jar</bootclasspath>
</compilerArguments>
</configuration>
@matrixcloud
matrixcloud / javaUtf8.sh
Created June 19, 2018 01:13
jvm file encoding
export JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF8"
// shack screen effect
// @duration
shakeEffect: function (duration) {
this.node.runAction(
cc.repeatForever(
cc.sequence(
cc.moveTo(0.02, cc.p(5, 7)),
cc.moveTo(0.02, cc.p(-6, 7)),
cc.moveTo(0.02, cc.p(-13, 3)),
cc.moveTo(0.02, cc.p(3, -6)),
with codecs.open('./tmp/' + yt.title + '.xml', 'w+', 'utf-8') as f:
f.write(caption.xml_captions)
@matrixcloud
matrixcloud / logging.ini
Created January 19, 2019 11:33
Python logging config file
[loggers]
keys=root,app
[handlers]
keys=fileHandler,consoleHandler
[formatters]
keys=defaultFormatter
[logger_root]
#!/bin/sh
# create self-signed server certificate:
read -p "Enter your domain [www.example.com]: " DOMAIN
echo "Create server key..."
openssl genrsa -des3 -out $DOMAIN.key 1024