Skip to content

Instantly share code, notes, and snippets.

View lmduc's full-sized avatar

Duc Le lmduc

View GitHub Profile
@lmduc
lmduc / test-ruby-2.rb
Created May 28, 2019 07:32
test singleton class
def A
def say
p "in A"
end
end
a = A.new
def a.say
p "in singleton"
end
@lmduc
lmduc / test-ruby-1.rb
Last active May 28, 2019 07:29
test method chain ruby
module A
def say
p "in A"
end
end
module B
include A
def say
@lmduc
lmduc / Today I read.md
Created April 14, 2019 08:09
A simple log of what I read everyday

Ruby in a nut shell

String and symbol

String: 'hello world' or "hello world"

Symbol: :hello or :'hello world'

Differences:

@lmduc
lmduc / sum_square.md
Created February 21, 2019 16:04
Concurrent sum square C++
#include <bits/stdc++.h>
#include <thread>
#include <atomic>

using namespace std;

int MODULO = 123456789;

#define ll long long
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
return 0;
}
import React, { Component } from 'react'
import config from './particles.json'
class Particlejs extends Component {
componentDidMount() {
let script = document.createElement('script')
script.onload = function() {
particlesJS.load('particlejs', config)
}
script.src = "https://cdn.jsdelivr.net/npm/[email protected]/particles.min.js"
set background=dark
if version > 580
hi clear
if exists("syntax_on")
syntax reset
endif
endif
set t_Co=256
let g:colors_name = "flattown"
@lmduc
lmduc / install_es_2.4.2
Last active December 1, 2016 06:34
Install on Ubuntu 14.04
### Install Java 8
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
sudo apt-get install oracle-java8-installer -y
### Download and install the Public Signing Key
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
### Setup Repository