Skip to content

Instantly share code, notes, and snippets.

View laymonage's full-sized avatar
👋
looking for friends from around the world, hmu!

sag​e laymonage

👋
looking for friends from around the world, hmu!
View GitHub Profile
@laymonage
laymonage / Giscus.tsx
Last active July 4, 2021 16:11
giscus React component, install https://www.npmjs.com/package/iframe-resizer-react first
import { useEffect, useState } from 'react';
import IframeResizer from 'iframe-resizer-react';
const GISCUS_SESSION_KEY = 'giscus-session';
const GISCUS_ORIGIN = 'https://giscus.app';
const ERROR_SUGGESTION = `Please consider reporting this error at https://github.com/laymonage/giscus/issues/new.`;
function formatError(message: string) {
return `[giscus] An error occurred. Error message: "${message}".`;
}
@laymonage
laymonage / 01_create_user.sql
Created July 4, 2020 09:25
Oracle Database Docker image Django test setup
CREATE USER django IDENTIFIED BY django;
GRANT DBA TO django;
QUIT
@laymonage
laymonage / 01_create_user.sql
Last active July 4, 2020 09:04
Oracle Database Docker image Django test setup
CREATE USER django IDENTIFIED BY django;
GRANT DBA TO django;
QUIT
@laymonage
laymonage / LessWith6Factors.java
Last active June 19, 2020 10:46
Pintu Engineering Logic Test #3
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
public class LessWith6Factors {
private static int pRow;
private static int pCol;
@laymonage
laymonage / README.md
Last active June 19, 2020 09:15
Pintu Engineering Logic Test #2

Jade love uniqueness. Every time he found a string, he makes that string into multiple unique character strings. But Jade has a rule to make a new string, you can only remove the duplicate character, and cannot change the arrangement of the characters. Jade also sort the possibilities of the string in lexicographic order.

We consider lexicographic order of characters as their order of ASCII value. Hence the lexicographical order of character will be 'a', 'b', 'c', ..., 'y', 'z'.

For example:
string "sebaerb"

Possible arragements:

  • saerb -> the first in lexicographical order
@laymonage
laymonage / MaximumTrader.java
Last active June 19, 2020 09:15
Pintu Engineering Logic Test #1
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
public class MaximumTrader {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] pricesStr = br.readLine().split(" ");

sauna.reload: so that you can finish your Plone development today and relax in sauna after calling it a day

local

Introduction

@laymonage
laymonage / README.rst
Last active April 8, 2019 14:30 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText

Table of Contents

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as

@laymonage
laymonage / django_mariadb_test_results.txt
Created April 7, 2019 06:25
Django test results with MariaDB 10.3.14 stable database backend.
======================================================================
ERROR: test_trunc_ambiguous_and_invalid_times (db_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.7/unittest/case.py", line 59, in testPartExecutor
yield
File "/usr/lib64/python3.7/unittest/case.py", line 615, in run
testMethod()
File "/home/sage/gsoc/django/django/tests/db_functions/datetime/test_extract_trunc.py", line 1055, in test_trunc_ambiguous_and_invalid_times
model = DTModel.objects.annotate(truncated_start=TruncDay('start_datetime')).get()
@laymonage
laymonage / gsoc-2019-django-laymonage-proposal.rst
Last active April 3, 2023 11:46 — forked from chrismedrela/gist:82cbda8d2a78a280a129
Add Cross-DB JSONField and ArrayField: Proposal for Django in Google Summer of Code 2019 by Sage M. Abdullah.

Add Cross-DB JSONField and ArrayField

Proposal for Django in Google Summer of Code 2019 by Sage M. Abdullah.

Table of Contents

Abstract