Skip to content

Instantly share code, notes, and snippets.

View hanh090's full-sized avatar

Hanh Le hanh090

  • Ho Chi Minh City
View GitHub Profile
[
{
"id": "1ddf64b0-6191-482e-b466-21f593560001",
"date": "2021-05-17T10:37:11",
"slug": "eiusmod-adipisicing-officia-do-pariatur-eu",
"title": "Ea reprehenderit non occaecat qui eiusmod Lorem ex anim enim deserunt incididunt exercitation nulla.",
"picture": {
"thumbnail": "https://images.unsplash.com/photo-1626131719997-e216ff236c40?fit=crop&q=80&w=800&h=600",
"medium": "https://images.unsplash.com/photo-1626131719997-e216ff236c40?fit=crop&q=80&w=1280&h=720",
"large": "https://images.unsplash.com/photo-1626131719997-e216ff236c40?fit=crop&q=80&w=1920&h=1080"
// Request: http://localhost:3000/api/v2/organisations/1/onboarding_checklists/2
{
"all_required": true,
"assignee_ids": [],
"boarding_tasks": [
{
"full_description": null,
"due_date": 0,
"assign_to": [],
"assignee_ids": [
{
"items": [
{
"id": 37,
"description": "test owner",
"full_description": "gdsgsd",
"status": "pending",
"due_date": 1587427200000,
"completed_at": null,
"assignee": {
@hanh090
hanh090 / memoize1.js
Last active March 18, 2020 02:26
Correct way to using memoize in EH project
// Import memoize from lodash fp package - it is convention in EH project
import memoize from 'lodash/fp/memoize';
// in lodash functional programming, memoize only have 1 argument
// this is code to changed to original API which support keyResolver
const memoizeWithResolver = memoize.convert({ fixed: false });
const keyResolver = (...args) => JSON.stringify(args);// Just sample code, you can choose method which you prefer
const withMemo = memoizeWithResolver((a,b) => doSomethingWith(a,b), keyResolver)
if var_a then
if var_b then
'using @var_b here is ok'
'using @var_b here is NOT ok'
import static java.lang.System.out;
out.println("Do you love me?");
Scanner sc=newScanner("System.in");
String result=sc.nextLine();
switch(result){
case"yes":out.println("I love you too");break;
case"no":out.println("Please choose another answer");break;
}
@hanh090
hanh090 / test.java
Last active January 27, 2018 02:22
System.out.println("Do you love me?");
Scanner sc = new Scanner("System.in");
String result = sc.nextLine();
switch(result) {
case "yes": sysout("I love you too"); break;
case "no": sysout("Please choose another answer");break;
}
for(inti=0;i<Y2018.days().length;i++){
if(QA.test(Y2018.days()[i])=="BUG"){
public hasBoyfriend(Girl girl){
if(girl.body == "90-60-90"){
return 1;
}
if(girl.face LIKE "NgocTrinh" OR LIKE "MariaOzawa"){
return 0.9999;
}
if (girl.body == "90-90-90" OR girl.face LIKE "ThiNo"){
return 0;
<form data-hns-namespace="form">
{/* // Info of this transect consist of observer and location id */}
<fieldset name="fs-info">
<Field type="text" caption="Datatypist" name="" />
<Field type="select" caption="Choose your transect" name="" validation="required" />
<Field type="text" caption="Observers and companions" name="" />
</fieldset>
<fieldset name="fs-event">
<Field type="date" caption="Date" validation="required" />
<Field type="hour" caption="From" />
@hanh090
hanh090 / gitlab-markdown-toc.js
Created December 13, 2017 03:05 — forked from gotofritz/gitlab-markdown-toc.js
creates a gitlab markdown table of contents for a README.md page
// quick and dirty snippet to creates a gitlab markdown table of contents for a README.md page
// preview gitlab page and paste in browser console
var str = "";
$('.file-content')
.find('h1, h2, h3, h4, h5, h6, h7')
.each((i, node) => {
// node.tagName is H1 H2...
let indent = Number(node.tagName[1]) - 1;
// markdown mested lists are
// - xxx