Skip to content

Instantly share code, notes, and snippets.

View slavafomin's full-sized avatar
✌️
Let's make this World a better place!

Slava slavafomin

✌️
Let's make this World a better place!
View GitHub Profile
@slavafomin
slavafomin / install-telegram.sh
Last active June 2, 2017 15:40
Install Telegram on Ubuntu using shell automatically
#/usr/bin/env bash
set -o errexit
set -o pipefail
shopt -s nullglob
INSTALL_PATH="$HOME/Telegram"
TEMP_PATH="$HOME/.tmp"
sudo apt-get install xz-utils
@lukas-h
lukas-h / license-badges.md
Last active April 14, 2025 17:15
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@slavafomin
slavafomin / 0-README.md
Last active January 19, 2016 11:24
Angular.js Directive for Vimeo Player
@slavafomin
slavafomin / Gulp-JavaScript-Resolve-Dependencies.md
Last active February 11, 2016 15:12
Gulp JavaScript Resolve Dependencies

Gulp JavaScript Resolve Dependencies

This Gulp task will resolve JavaScript dependencies and build individual bundles.

Install pre-requisites:

npm i --save-dev gulp gulp-resolve-dependencies gulp-uglify gulp-if gulp-foreach

Specify dependencies in your files:

@branneman
branneman / prototypal-inheritance.js
Last active October 18, 2021 06:18
ES3 & ES5 — Prototypal Inheritance
/**
* Parent
*/
function Shape(x, y) {
this.x = x;
this.y = y;
}
Shape.prototype.constructor = Shape;
Shape.prototype.pos = function() {
return [this.x, this.y];
@inso
inso / Nginx redirect to named location
Last active November 5, 2024 14:34 — forked from ilguzin/nginx_redirect_2named_location
NGINX: Redirect from current location into named location
# Solution 1
# Use only codes greater than 418, do not use common status codes 404, 402, 403, etc
location /location1 {
error_page 463 = @app; return 463;
}
# Solution 2 (drawbacks unknown)
location /location2 {
try_files /dev/null @app;
}
@DarrenN
DarrenN / get-npm-package-version
Last active April 12, 2025 14:15 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@jhngrant
jhngrant / postgresql-debugger-install-ubuntu
Last active January 17, 2025 22:54
Installing the PL/pgSQL Debugger Extension (pldbgapi) for pgAdmin III on PostgreSQL 9.4 and Ubuntu 14.10
# PostgreSQL can be on a remote server but you'll need root privileges in Linux and superuser in PostgreSQL.
# First install build tools
sudo su
aptitude install build-essential
aptitude install postgresql-server-dev-9.4
# Clone and build the PL/pgSQL server-side debugger
@seebk
seebk / README.md
Last active July 23, 2024 22:43
Extract embedded certificates and keys from OpenVPN config files

This python script is intended to automate the extraction of embedded certificates and keys from OpenVPN config files.

Unfortunately the GNOME Network-Manager is not able to automatically import OpenVPN config files with embedded certificates and keys. A workaround is to manually extract these and store them in separate files (e.g. see https://naveensnayak.wordpress.com/2013/03/04/ubuntu-openvpn-with-ovpn-file/).

Instructions:

  • Make shure all the required packages are installed. For example on Ubuntu and Debian run:

    $ sudo apt-get install python3 network-manager-openvpn-gnome

@slavafomin
slavafomin / 0-readme.md
Last active April 4, 2020 04:29
Loop promises in Angular.js / Run list of actions sequantually

The provided example will allow you to do sequential requests to the server in Angular.js.

It will iterate all the items and call server for each item, however, if one request will fail, all sequential requests will be aborted.

If you need to call all requests no matter what, just replace promise.then() with promise.finally().

Cheers!