Skip to content

Instantly share code, notes, and snippets.

View 3ackdoor's full-sized avatar
🏠
Working from home

3ackdoor

🏠
Working from home
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<profiles version="21">
<profile kind="CodeFormatterProfile" name="AAA - Intellij Java Code Style" version="21">
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="GoogleStyle" version="13">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
@3ackdoor
3ackdoor / search.sh
Created March 5, 2021 05:59 — forked from jonlabelle/search.sh
Bash script to search file contents (by file extension) for the specified search term. Uses grep under the hood.
#!/usr/bin/env bash
# shellcheck disable=SC2034,SC2086,SC2155,SC2001,SC2048
#
# Search file contents (by file extension) for the specified search term.
#
# grep options:
#
# -i Perform case insensitive matching.
# −r Recursively search subdirectories listed.
@3ackdoor
3ackdoor / string-utils.js
Created March 5, 2021 05:56 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
// String utils
//
// resources:
// -- mout, https://github.com/mout/mout/tree/master/src/string
/**
* "Safer" String.toLowerCase()
*/
function lowerCase(str) {
return str.toLowerCase();
@3ackdoor
3ackdoor / splitObjectToString.js
Last active October 19, 2023 10:11
handle response size limitation for GET method
const obj = { a: 1, b: 2, c: 3 }
const splitObjectToString = (obj, minSubStr) => {
let strArr = []
const strObj = JSON.stringify(obj)
for(let i = 0, indexStr = 0, stringNum = 0; i < strObj.length; i++){
if(i % minSubStr === 0 && i !== 0){
if(strObj.length - indexStr > minSubStr ){
stringNum++
strArr = [...strArr, { [`string${stringNum}`]: strObj.substring(indexStr, i) }]
@3ackdoor
3ackdoor / cb.js
Last active June 12, 2020 08:55
practice - using callback with an array
const number = [1,2,3,4,5,6,7,8,9,10]
let array = []
function asyncFunc (running) {
// for(let [index, value] of number.entries()) {
// running(value) // or running(index)
// }
number.forEach((value, index) => {