This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install build-essential autotools-dev tcl8.5-dev tk8.5-dev | |
cd $HOME | |
mkdir build && cd build | |
wget ftp://gadoid.ices.cmu.edu/pub/tkgate/pre-release/tkgate-2.0-b10.tar.gz | |
tar xvzf tkgate-2.0-b10.tar.gz | |
cd tkgate-2.0-b10/ | |
./configure | |
make | |
# Only if you want to install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar font-lock-format-specifier-face | |
'font-lock-format-specifier-face) | |
(defface font-lock-format-specifier-face | |
'((t (:inherit font-lock-preprocessor-face))) | |
"Font Lock mode face used to highlight format specifiers." | |
:group 'font-lock-faces) | |
(defun highlight-format-specifier () | |
(font-lock-add-keywords |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define PROXY_FN | |
export async function onRequest(context) { | |
const { request, params, env } = context; | |
const url = new URL(request.url); | |
url.host = env.API_HOST; | |
url.pathname = params.path.join('') === 'json' ? `/api/json` : params.path.join('/'); | |
if (request.method === 'POST' && !request.headers.get('Content-Type')) { | |
const headers = Object.fromEntries(request.headers.entries()) | |
return fetch(url, { | |
method: request.method, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* react-catalyst.js | |
* | |
* LinkedState for Facebook's React UI Library. Add support for | |
* deep path state access. | |
* | |
* Author: Tung Dao <me@tungdao.com> | |
* | |
* Usage: | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim Keymap file for vietnamese through the Telex method | |
" Maintainer: Tung Dao <tungd.dao@gmail.com> | |
" Last Change: 30 Aug 2011 | |
scriptencoding utf-8 | |
let b:keymap_name = "vietnamese" | |
loadkeymap | |
a a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group = "com.tungdao.sample" | |
extra["spring.version"] = "5.1.3.RELEASE" | |
extra["spring.boot.version"] = "2.1.1.RELEASE" | |
extra["spring.cloud.version"] = "Greenwich.RC2" | |
plugins { | |
java | |
idea | |
id("org.springframework.boot") version "2.1.1.RELEASE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* react-helper.js | |
* | |
* Helper for Facebook's React UI Library. Add support for declare | |
* component on DOM (similar to AngularJS Directive). | |
* | |
* Usage: | |
* - Register a component: | |
* ReactHelper.register('MyComponent', MyComponent) | |
* - Declare the DOM node: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Sequelize = require('sequelize') | |
const sequelize = new Sequelize({ | |
dialect: 'sqlite', | |
storage: 'db.sqlite3' | |
}) | |
const Product = sequelize.define('product', { | |
name: Sequelize.STRING | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!defined('_PS_VERSION_')) exit; | |
class TD_Shortcode extends Module { | |
protected static $initialized = false; | |
public function __construct() { | |
$this->name = 'td_shortcode'; | |
$this->tab = 'front_office_feature'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xlsx = require('xlsx') | |
const table = xlsx.readFile('sample.xlsx', { cellStyles: true }) | |
const sheet = table.Sheets[table.SheetNames[0]]; | |
console.log(sheet) | |
// sheet['C10'] = { t: 's', v: 'Test update value' } | |
const addCell = (sheet, cell, value) => { | |
sheet[cell] = Object.assign({}, sheet[cell], value) |
NewerOlder