Skip to content

Instantly share code, notes, and snippets.

View safizn's full-sized avatar
🏗️
Developing...

Safi safizn

🏗️
Developing...
View GitHub Profile
@safizn
safizn / TA_script.sh
Last active July 21, 2023 02:25
regex serach for brackets usage
#!/bin/bash
# resources
# https://www.sentinelone.com/blog/search-your-files-with-grep-and-regex/
# https://jex.im/regulex/#!flags=&re=%5E(a%7Cb)*%3F%24
# https://regex101.com/r/8NLngW/1
# https://www.cyberciti.biz/faq/grep-regular-expressions/
# Also you can always ask ChatGPT for specifics
# regex101 flavor:
# /\[.*(?!^$)([^\s]).*\]/gm
@safizn
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
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
pause
break
}
@safizn
safizn / nodeInclude
Created February 25, 2019 23:35
Execute file code as if written locally.
const include = (file) => { eval(filesystem.readFileSync(file) + '') }
@safizn
safizn / How_Require_Extensions_Work.md
Created January 6, 2019 13:44 — forked from jamestalmage/How_Require_Extensions_Work.md
Breakdown of How Require Extensions Work

Why

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?

// https://www.accelebrate.com/blog/javascript-es6-classes-and-prototype-inheritance-part-1-of-2/
// 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.
# http://codeketchup.blogspot.co.il/2016/05/how-to-clean-and-reset-jenkins-build.html
def jobName = "education-webapp"
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().each { it.delete() }
job.nextBuildNumber = 1
job.save()
@safizn
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 https://deb.nodesource.com/setup_5.x | bash -
sudo apt-get update
https://intense-heat-1283.firebaseio.com/.json?format=export&auth=6f1iIOoYc5pFnZ0vgly5DYYwWWX3BZ5a1KDSCBFK