Skip to content

Instantly share code, notes, and snippets.

View bikrone's full-sized avatar

Hai-Khanh Nguyen bikrone

View GitHub Profile
@bikrone
bikrone / config.lua
Last active April 16, 2024 08:54
config.lua for lvim
--[[ lvim is the global options object Linters should be filled in as strings with either a global executable or a path to an executable
]]
-- require('swenv.api').get_current_venv()
-- general
lvim.log.level = "warn"
lvim.format_on_save.enabled = true
lvim.builtin.theme.name = "tokyonight"
lvim.colorscheme = "onedark"
lvim.builtin.terminal.size = 15
using UnityEditor;
using UnityEngine;
public sealed class ExampleClass : EditorWindow
{
private static readonly string[] mList =
{
"AboutWIndowLicenseLabel" ,
"AC LeftArrow" ,
"AC RightArrow" ,
@bikrone
bikrone / Magic keyboard AutoHotkey configuration
Created November 1, 2019 23:39
Magic keyboard AutoHotkey configuration
LWin::LCtrl
; Remap cmd+Tab to Alt+Tab
; Media keys
RWin & F7::SendInput {Media_Prev}
RWin & F8::SendInput {Media_Play_Pause}
RWin & F9::SendInput {Media_Next}
RWin & F10::SendInput {Volume_Mute}
RWin & F11::SendInput {Volume_Down}
@bikrone
bikrone / 0_reuse_code.js
Created October 17, 2016 17:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bikrone
bikrone / mysql_size.sql
Created August 8, 2015 06:21
Check mysql database size
SELECT table_schema "Data Base Name",
sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB",
sum( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
GROUP BY table_schema ;
public static Task<string> downloadUrl(string url)
{
return new Task<string>(() =>
{
Task<string> task;
using (WebClient wc = new WebClient())
{
Console.WriteLine("Start downloading");
task = wc.DownloadStringTaskAsync(url);
@bikrone
bikrone / StringTest.cs
Created July 6, 2015 11:13
Test string finding performance (KMP, indexOf, Regex) in c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Text.RegularExpressions;
namespace StringTest
{
@bikrone
bikrone / Regex
Last active August 29, 2015 14:24
Regex
Html tag Regex
// with attribute
<(\/?\w+)((?:\s+[\w:-]+\s*=?\s*([\"\']?).*?\3)*\s*)\/?>
// without attribute
<(\/?\w+)(?:\s+[\w:-]+\s*=?\s*([\"\']?).*?\2)*\s*\/?>
<\/?(\w+)((\s+[\w:-]+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>
vector<vector<int> > Solution::permute(vector<int> &A) {
vector<vector<int> > listOfPermutations;
vector<int> B;
// get the first permutation
sort(A.begin(), A.end());
// add the first permutation in the list
listOfPermutations.push_back(A);
int n = A.size();
/*
* main.c
*
* Created on: May 22, 2015
* Author: khanh
*/
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>