Skip to content

Instantly share code, notes, and snippets.

View djhojd's full-sized avatar

Claudiu Hojda djhojd

View GitHub Profile
This file has been truncated, but you can view the full file.
var t,a;"function"==typeof(t=globalThis.define)&&(a=t,t=null),function(a,r,e,l,o){var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},n="function"==typeof i[l]&&i[l],c=n.cache||{},h="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(t,r){if(!c[t]){if(!a[t]){var e="function"==typeof i[l]&&i[l];if(!r&&e)return e(t,!0);if(n)return n(t,!0);if(h&&"string"==typeof t)return h(t);var o=Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}g.resolve=function(r){var e=a[t][1][r];return null!=e?e:r},g.cache={};var d=c[t]=new u.Module(t);a[t][0].call(d.exports,g,d,d.exports,this)}return c[t].exports;function g(t){var a=g.resolve(t);return!1===a?{}:u(a)}}u.isParcelRequire=!0,u.Module=function(t){this.id=t,this.bundle=u,this.exports={}},u.modules=a,u.cache=c,u.parent=n,u.register=function(t,r){a[t]=[function(t,a){a.exports=r},{}]},Object.defineProperty(u,"root",
# Source: https://github.com/orgs/community/discussions/26291#discussioncomment-3251245
launch_as() {
local cmd_name=$1
shift
(time $@ || echo $cmd_name >> fail.txt) 2>&1 > $cmd_name.txt
}
time npm ci
launch_as lint npm run lint &
time npm run build
launch_as build1 npm run build:build1 &
@djhojd
djhojd / git-clean-local-branches.sh
Created December 14, 2021 12:03
Delete local GIT branches that were deleted on remote repository
# https://medium.com/@kcmueller/delete-local-git-branches-that-were-deleted-on-remote-repository-b596b71b530c
git branch -vv | grep ': gone]'| grep -v "\*" | awk '{ print $1; }' | xargs -r git branch -D
@djhojd
djhojd / rm-node_modules.sh
Created December 2, 2021 18:24
Remove node_modules recursively
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
@djhojd
djhojd / git-prompt.sh
Created November 28, 2021 20:07
Git Prompt (~/.config/git/git-prompt.sh)
if test -f /etc/profile.d/git-sdk.sh
then
TITLEPREFIX=SDK-${MSYSTEM#MINGW}
else
TITLEPREFIX=$MSYSTEM
fi
PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # set window title
PS1="$PS1"'\n' # new line
# PS1="$PS1"'\[\033[32m\]' # change to green
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
$MachineName = $env:computername
$InstanceName = "SQLEXPRESS"
$ServerInstance = "$MachineName\$InstanceName"
Get-SqlInstance -ServerInstance $ServerInstance
# Provide SQLServerName
$SQLServer = "MySQLSErver\InstanceName"
# Provide Database Name
$DatabaseName = "my-db-name"
FROM node:8-slim
# --------------------------------------
# Install Chrome
# --------------------------------------
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable --no-install-recommends
import { Directive, Output, EventEmitter, HostListener } from '@angular/core';
@Directive({
selector: '[click.stop],[clickStop]'
})
export class StopPropagationDirective {
@Output("click.stop") stopPropEvent = new EventEmitter();
@HostListener('click', ['$event'])
onClick(event: Event) {
@djhojd
djhojd / play-music.sh
Created February 10, 2016 11:41
find mp3/flac, sort by last access time, take top 10, sort random, play
#!/bin/bash
while true; do
find ./ -regex '.*\.\(mp3\|flac\)' -printf '%T+ %p\n' | sort | head -n 10 | sort --random-sort | while read f; do
mplayer -quiet "$f" </dev/tty;
touch "$f";
done
sleep 1
done