Skip to content

Instantly share code, notes, and snippets.

sunnyone

Block or report user

Report or block sunnyone

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sunnyone
sunnyone / hoge.html
Created Jun 22, 2019
performance trace
View hoge.html
<html>
<head></head>
<body>
<script>
window.perf1start = performance.now();
</script>
<link rel="stylesheet" href="" />
<script>
var perf1 = performance.now() - window.perf1start;
@sunnyone
sunnyone / entrypoint.sh
Created Apr 25, 2019
Gollum entrypoint.sh
View entrypoint.sh
#!/bin/sh
cd /work
exec bundle exec bin/gollum -p 80 /wiki
View gist:d3cd8e10159c3be7792c8dc41ede193e
FROM ruby
RUN apt-get -y update && apt-get -y install libicu-dev cmake && rm -rf /var/lib/apt/lists/*
COPY . /work
RUN cd /work && bundle install --path vendor/bundle
WORKDIR /wiki
ENTRYPOINT ["/work/entrypoint.sh"]
EXPOSE 80
View AspNetIdentityV2PasswordEncoder.kt
package jp.syginc.aqua.common.security
import org.springframework.security.crypto.password.PasswordEncoder
import org.springframework.security.crypto.util.EncodingUtils
import java.security.GeneralSecurityException
import java.util.Base64
import javax.crypto.SecretKeyFactory
import javax.crypto.spec.PBEKeySpec
class AspNetIdentityV2PasswordEncoder : PasswordEncoder {
View ManageScroll.js
import React from "react";
import { Location } from "@reach/router";
let scrollPositions = {};
class ManageScrollImpl extends React.Component {
componentDidMount() {
try {
// session storage will throw for a few reasons
// - user settings
View tsconfig-test.json
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
View CustomizedNamedParameterJdbcTemplate.kt
fun convert(value: Any?, sqlType: Int, typeName: String?): Triple<Any?, Int, String?> {
if (value is CodedEnum) {
return Triple(value.code, sqlType, typeName)
}
return Triple(value, sqlType, typeName)
}
open class CustomizedNamedParameterJdbcTemplate(classicJdbcTemplate: JdbcOperations) :
View SpringDataJdbcConfig.kt
@EnableJdbcRepositories
@Configuration
open class SpringDataJdbcConfig : JdbcConfiguration() {
@Bean
open fun namedParameterJdbcTemplate(jdbcTemplate: JdbcTemplate): NamedParameterJdbcTemplate {
return CustomizedNamedParameterJdbcTemplate(jdbcTemplate)
}
@Bean
@sunnyone
sunnyone / webpack.config.js
Created Sep 23, 2018
webpack-dev-server proxy example
View webpack.config.js
devServer: {
contentBase: 'dist',
host: '0.0.0.0',
port: 3000,
proxy: {
'/myapp/api': {
target: 'http://api-server:8080'
},
'/myapp': {
target: 'http://localhost:3000/examples/index.html',
View gist:422f2b23c5f497bf099035a80002bad8
sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /opt/HipChat4/lib/libssl.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /opt/HipChat4/lib/libcrypto.so
You can’t perform that action at this time.