Skip to content

Instantly share code, notes, and snippets.

View angel-vladov's full-sized avatar

Angel Vladov angel-vladov

View GitHub Profile
@angel-vladov
angel-vladov / metadata.json
Created June 6, 2021 13:22
Cardano Test Pool
{
"name": "Cardano Test Pool - A",
"description": "Cardano Test pool",
"ticker": "TEST-A",
"homepage": "https://github.com/abracadaniel/cardano-node-docker"
}
function Write-BranchName () {
try {
$branch = git rev-parse --abbrev-ref HEAD
if ($branch -eq "HEAD") {
# we're probably in detached HEAD state, so print the SHA
$branch = git rev-parse --short HEAD
Write-Host " ($branch)" -ForegroundColor "red"
}
else {
@angel-vladov
angel-vladov / .bash_prompt
Last active October 15, 2019 11:55
Manjaro Gnome bash with Git branch
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\]\h\[\033[01;36m\] \W\[\033[01;31m\]\[\033[00;37m\]$(git_branch 2>/dev/null)\[\033[01;32m\]\$\[\033[00m\] '
else
PS1='\[\033[01;32m\]\u@\h\[\033[01;37m\] \W\[\033[01;32m\]\[\033[00;37m\]$(git_branch 2>/dev/null)\[\033[01;32m\]\$\[\033[00m\] '
fi
@angel-vladov
angel-vladov / enable-sourcemaps.patch
Created September 27, 2018 20:33
Working Angular 6 SCSS Sourcemaps
--- node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/styles.js
+++ node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/styles.js
@@ -220,7 +220,7 @@ function getStylesConfig(wco) {
options: {
ident: 'embedded',
plugins: postcssPluginCreator,
- sourceMap: cssSourceMap
+ sourceMap: cssSourceMap ? 'inline' : false
}
},
@angel-vladov
angel-vladov / .bash_profile
Last active August 29, 2018 10:05
Mac OS terminal prompt with git branch
export PATH="/usr/local/bin:$PATH"
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1='\[\033[32m\]' # change to green
PS1="$PS1"'\u@\h ' # user@host<space>
@angel-vladov
angel-vladov / select2-bootstrap4.after.scss
Last active March 16, 2018 16:01
Select2 for Bootstrap4
// Import this file after select2 bootstrap theme. Content won't be centered if you don't include this file.
.select2-container--bootstrap {
.select2-selection--multiple {
.select2-selection__choice {
margin-top: calc(#{$s2bs-padding-base-vertical} - 1px);
}
.select2-search--inline .select2-search__field {
height: $s2bs-input-height-base;
}
@angel-vladov
angel-vladov / jquery-plugin-example.js
Last active December 6, 2016 11:35
jQuery prototypical plugin example
// globals jQuery
(function ($) {
'use strict';
// TODO: Replace pluginExample and PluginExample with your plugin name
$.fn.pluginExample = function (option/*, varArgs*/) {
var args = Array.prototype.slice.call(arguments, 1);
return this.each(function () {
var $element = $(this);
@angel-vladov
angel-vladov / crosswalk-no-ssl-error.js
Last active August 31, 2016 14:55
Cordova hook that disables Crosswalk SSL error checks. Otherwise HTTPS doesn't work with Android 5.
#!/usr/bin/env node
// Disables crosswalk release time SSL errors check
// v1.0
// Install mkdirp before using this hook. Run npm install mkdirp --save
// Place this file in hooks/after-prepare
// Confirmed working with Crosswalk 1.7.2
var fs = require('fs');
var path = require('path');
@angel-vladov
angel-vladov / cordova_stream_ring.js
Last active July 21, 2016 07:36
Cordova hook for ringer volume controled Media on Android
#!/usr/bin/env node
// Changes your app to use STREAM_RING instead of STREAM_MEDIA
// v1.0
// Install mkdirp before using this hook. Run npm install mkdirp --save
// Place this file in hooks/after-prepare
// This hook will change AudioManager.STREAM_MUSIC to AudioManager.STREAM_RING
var fs = require('fs');
var path = require('path');
@angel-vladov
angel-vladov / soundjs-cordova.js
Created April 9, 2016 23:04
Using createjs WebAudioPlugin with Phonegap (Cordova)
(function() {
'use strict';
var XHRRequest = createjs.XHRRequest;
var XHRRequest_checkError = XHRRequest.prototype._checkError;
XHRRequest.prototype._checkError = function () {
// Override of version 0.62 implementation
if ('cordova' in window) {