Skip to content

Instantly share code, notes, and snippets.

View truongan's full-sized avatar

TrườngAn PhạmNguyễn truongan

View GitHub Profile
mount -t proc /proc proc/ && mount -t sysfs /sys sys/ && mount --rbind /dev dev/ && mount --rbind /sys/firmware/efi/efivars sys/firmware/efi/efivars/
document.querySelector(".module-left-pane--width-wide").style.width = document.querySelector(".module-left-pane__list > div").style.width = "250px"
$(document).ready(function(){
function getColor(noOfColors){
html="";
frequency=5/noOfColors;
for (var i = 0; i < noOfColors; ++i){
r = Math.floor(Math.sin(frequency*i + 0) * (127) + 128);
g = Math.floor(Math.sin(frequency*i + 2) * (127) + 128);
b = Math.floor(Math.sin(frequency*i + 4) * (127) + 128);
@truongan
truongan / print.tree.cpp
Last active March 27, 2019 10:09
Generate a random tree and print it like 'tree' format
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
struct node{
int id;
vector<node*>children;
};
@truongan
truongan / wchar literal in C++
Last active December 21, 2017 07:00
How to write a wchar literal in C++ and output its binary representation
#include <iostream>
#include <bitset>
using namespace std;
int main()
{
wchar_t A[] = L"bỏ dấu cho đúng chính tả em ơi";
for(auto x : A){
cout << bitset<16>( x ) << endl;
}
}
$this->pagination_config['full_tag_open'] = '<nav><ul class="pagination justify-content-center">';
$this->pagination_config['full_tag_close'] = '</ul></nav>';
$this->pagination_config['num_tag_open'] = '<li class="page-item">';
$this->pagination_config['num_tag_close'] = '</li>';
$this->pagination_config['cur_tag_open'] = '<li class="page-item active"><span class="page-link">';
$this->pagination_config['cur_tag_close'] = '<span class="sr-only">(current)</span></span></li>';
$this->pagination_config['next_tag_open'] = '<li class="page-item"><a ';