Skip to content

Instantly share code, notes, and snippets.

@hechien
hechien / Dockerfile
Created February 13, 2024 13:37
PHP + PDO_IBM
FROM php:apache
RUN apt-get update
RUN apt-get -y upgrade
RUN apt install -y apt-utils build-essential
ENV IBM_DB_HOME=/opt/ibm/clidriver
ENV LD_LIBRARY_PATH="${IBM_DB_HOME}/lib"
RUN apt install -y apt-utils build-essential
@hechien
hechien / webpacker_rails.md
Created August 23, 2020 02:40 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails
@hechien
hechien / 20150731014159_create_no_id_models.rb
Created August 18, 2020 09:01 — forked from bunyan/20150731014159_create_no_id_models.rb
Rails 4.2: composite_primary_keys 8.1.0 and activerecord-sqlserver-adapter 4.2.4 generating wrong SQL on some queries
class CreateNoIdModels < ActiveRecord::Migration
def change
create_table :no_id_models, id: false do |t|
t.integer :pk1
t.integer :pk2
end
end
end
for(let i = 0; i < tr_length; i++) {
let
detailBtn = `[checkDetailBtn=${i}]`,
dropdownMenu = `[dropDownMenu=${i}]`
$(document).on('click', detailBtn, function(){
$(dropdownMenu).slideToggle()
})
}
/*
* Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@hechien
hechien / five_mice_convert.rb
Last active March 22, 2020 03:34
用 Ruby 寫的小東西
#!/usr/bin/env ruby
# 五鼠遁起法
class GanZhiTable
TIAN_GAN = "甲乙丙丁戊己庚辛壬癸".split("").freeze
DI_ZHI = "子丑寅卯辰巳午未申酉戌亥".split("").freeze
def tian_gan(index)
index = index - TIAN_GAN.size if index >= TIAN_GAN.size
@hechien
hechien / rails_webpacker_bootstrap_expose_jquery.md
Created April 30, 2019 14:26 — forked from andyyou/rails_webpacker_bootstrap_expose_jquery.md
Rails 5.2 with webpacker, bootstrap, stimulus starter

Rails 5.2 with webpacker, bootstrap, stimulus starter

This gist will collects all issues we solved with Rails 5.2 and Webpacker

Create Project

# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
#include <iostream>
#include <string>
using namespace std;
int convert(string,char,char);
int main(void)
{
string input;
[supervisord]
nodaemon=true
[program:sshd]
command=/usr/sbin/sshd -D
autorestart=true
[program:apache2]
command=/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFORGROUND"
autorestart=true
set daemon 20
set logfile syslog facility log_daemon
set mailserver smtp.gmail.com port 587
username "ERROR-EMAIL-ADDRESS" password "PASSWORD"
using tlsv1
with timeout 30 seconds
set alert ERROR-EMAIL-ADDRESS
set httpd port 2812 and