Skip to content

Instantly share code, notes, and snippets.

View safizn's full-sized avatar

Safi safizn

View GitHub Profile
safizn /
Last active July 21, 2023 02:25
regex serach for brackets usage
# resources
# Also you can always ask ChatGPT for specifics
# regex101 flavor:
# /\[.*(?!^$)([^\s]).*\]/gm
safizn / 100
Last active April 9, 2021 17:36
eclipse-java-google-style (modified for cs class).xml
<?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"/>
safizn / gist:167319cb33c25e96194d12554349a031
Created October 9, 2019 13:17
Powershell - compare commandline path to current executed script path
# Must be executed from the root path of the git repository.
$commandlineCurrentPath = pwd # Get-Location equivalent
$currentExecutedScriptPath = $PSScriptRoot
$parentOfCurrentExecutedScriptPath = Split-Path -Path $currentExecutedScriptPath -Parent
if(-Not ($parentOfCurrentExecutedScriptPath -eq $commandlineCurrentPath) ){
$message = "Error ! This script must be executed from the root path of the git repository, as it needs to verify path of WSL scripst executed from it."
Write-Host $message -ForegroundColor Red -BackgroundColor Black
safizn / nodeInclude
Created February 25, 2019 23:35
Execute file code as if written locally.
const include = (file) => { eval(filesystem.readFileSync(file) + '') }
safizn /
Created January 6, 2019 13:44 — forked from jamestalmage/
Breakdown of How Require Extensions Work


Doing require extensions correctly is essential, because:

  1. Users should be able to install multiple extensions in succession, and have them work together.
  2. Coverage tools like nyc need it to reliably supply coverage information that takes into account sourcemaps from upstream transforms.
  3. Because non-standard, un-predictable behavior causes hard to solve bugs, and major headaches for project maintainers.

What is a require extension anyways?

// the extends function is not already defined within the current
// context; therefore, define it
export function extendClass({ childClass, parentClass }) {
// mixin pattern for copying parent constructor function properties
// as static properties to the child constructor function
// properties on constructor function are commonly known as static
// properties
for (var parentPropertyName in parentClass) {
# Delete all build history of specific job pipeline.
def jobName = "education-webapp"
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().each { it.delete() }
job.nextBuildNumber = 1
safizn / Nodejs
Last active February 24, 2017 18:00
# Node.js
# versions
node -v
node -p 'process.versions.v8'
# Install nodejs
# Using Debian, as root
sudo curl -sL | bash -
sudo apt-get update