Skip to content

Instantly share code, notes, and snippets.

View gjlmotea's full-sized avatar

GJLMoTea gjlmotea

View GitHub Profile
@gjlmotea
gjlmotea / Possibility of Customized Personalized Coding Style across Collaborations.md
Last active November 8, 2023 15:05
Possibility of Customized Personalized Coding Style across Collaborations.md

Re-imagining Personalized Code Formatting - A Vision for a Customizable Code Formatter

I feel that the current approach to code formatting seems too primitive. I want to spark everyone's imagination and discussion about personalized code formatting (which I'd like to call re-formatter). I wonder whether it's feasible or not. If it is, I hope someone will eventually take up the development of this idea.

About Coding Style

Code = the arrangement of logic as textual statements.

Everyone has their comfortable formatting style, just like reading an article. Text cannot be completely unformatted; it needs spaces and line breaks. This is aesthetics.

@gjlmotea
gjlmotea / C function使用.c
Created July 12, 2020 08:23
C function使用
#include <stdio.h>
#include <stdlib.h>
void hello(int a){
for(; a>0; a--){
printf("hello ");
}
printf("\n");
}
@gjlmotea
gjlmotea / C inline使用.c
Created July 12, 2020 08:15
C inline使用
#include <stdio.h>
#include <stdlib.h>
inline int hi(){
return "Hi~";
}
int main(int argc, char *argv[]) {
int i = 0;
for(i=0; i<1000; i++){
@gjlmotea
gjlmotea / C macro陷阱.c
Created July 12, 2020 07:24
C macro陷阱
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
#define PI 3.14159
#define Square(x) x*x
#define Square_(x) x*(x)
#define Square__(x) ((x)*(x))
printf("%f\n", PI);
@gjlmotea
gjlmotea / .zshrc
Last active July 4, 2020 19:38
.zshrc with g10k
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
ZSH_DISABLE_COMPFIX=true
export ZSH="$HOME/.oh-my-zsh"
HIST_STAMPS="yyyy-mm-dd"
@gjlmotea
gjlmotea / uBlock Origin.c
Last active April 26, 2020 11:23
ublock自定義--過濾語法清單
tw.appledaily.com##.article_body:style(overflow-y: auto ;height: auto!important)
#蘋果日報 tw.appledaily.com
*##.AdblockBanner
*###dmRelatedPlayer
*##.udn-idle
*##.udn-overlay
#Udn聯合新聞網 udn.com
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
carry = 0
l3 = ListNode
head = l3
while True:
if l1 == None and l2 == None and carry == 0:
break
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
list1 = []
list2 = []
while l1:
list1.append(l1.val)
l1 = l1.next
while l2:
@gjlmotea
gjlmotea / ListNode.py
Created April 3, 2020 05:10
ListNode
class ListNode:
def __init__(self, x, ListNode = None):
self.val = x
self.next = ListNode
@gjlmotea
gjlmotea / cpp
Created November 14, 2019 05:32
merge sort
#include <iostream>
#include <climits>
using namespace std;
void merge(int array[], int L, int M, int R){ //合併
/*
合併:
__ VS __
1 2