Skip to content

Instantly share code, notes, and snippets.

@sunnyone
sunnyone / entrypoint.sh
Created April 25, 2019 10:13
Gollum entrypoint.sh
#!/bin/sh
cd /work
exec bundle exec bin/gollum -p 80 /wiki
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
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 {
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
{
"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. */
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) :
@EnableJdbcRepositories
@Configuration
open class SpringDataJdbcConfig : JdbcConfiguration() {
@Bean
open fun namedParameterJdbcTemplate(jdbcTemplate: JdbcTemplate): NamedParameterJdbcTemplate {
return CustomizedNamedParameterJdbcTemplate(jdbcTemplate)
}
@Bean
@sunnyone
sunnyone / webpack.config.js
Created September 23, 2018 07:01
webpack-dev-server proxy example
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',
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
cat iamlist4.txt | perl -pne 's/(.*?:[A-Z][a-z]*)(.*)/$2 $1$2/' | sort | awk '{print $2}'