Skip to content

Instantly share code, notes, and snippets.

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

Slava Fomin II slavafomin

✌️
Let's make this World a better place!
View GitHub Profile
@masak
masak / explanation.md
Last active May 21, 2024 20:05
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@julionc
julionc / 00.howto_install_phantomjs.md
Last active June 7, 2024 11:29
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active June 7, 2024 01:58
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@CrowderSoup
CrowderSoup / find_replace.js
Created February 19, 2014 16:40
Replace all instances of a substring without Regex in JavaScript
var str = 'This is a test string.';
// Let's replace all spaces with ','
str = str.split(' ').join(',');
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@slavafomin
slavafomin / acl.md
Last active August 29, 2015 14:03
Useful commands for Ubuntu

ACL

Remove all ACL entries

setfacl -R -b

The list of extensions to exclude from web project when downloading

Images

  • svg
  • psd
  • ai
  • eps
  • gif
  • ico
@symn
symn / Image.js
Last active March 19, 2017 00:04
Retrieve a single random record of a Sails.js model
/**
* Image.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
@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!

@seebk
seebk / README.md
Last active April 24, 2024 07:17
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