Skip to content

Instantly share code, notes, and snippets.

View bzhr's full-sized avatar
💜
Upbeat-ing

Bozhidar Hristov bzhr

💜
Upbeat-ing
View GitHub Profile
@bzhr
bzhr / ip.js
Created July 17, 2020 13:19 — forked from ganapativs/ip.js
Get local external ip address with nodejs
var
// Local ip address that we're trying to calculate
address
// Provides a few basic operating-system related utility functions (built-in)
,os = require('os')
// Network interfaces
,ifaces = os.networkInterfaces();
// Iterate over interfaces ...
@bzhr
bzhr / pm_install.sh
Created March 1, 2018 13:14 — forked from punkdata/pm_install.sh
Postman Install Ubuntu 17.10
#!/usr/bash
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman
@bzhr
bzhr / drf-nested-views.py
Created December 29, 2017 19:22 — forked from dkarchmer/drf-nested-views.py
Example of a Django Rest Framework ViewSet with nested views
# ViewSets define the view behavior.
class FooViewSet(viewsets.ModelViewSet):
lookup_field = 'slug'
queryset = Foo.objects.all()
serializer_class = FooSerializer
def get_queryset(self):
"""
This view should return a list of all records
"""
@bzhr
bzhr / facebook_test_user.sh
Created August 30, 2017 13:27 — forked from kesor/facebook_test_user.sh
Login URL for Facebook test user
#!/bin/sh
set -e
#
# create a test user at developer.facebook.com and set these
#
FULL_NAME="Bob+Amchicieafci+Martinazziman"
APP_ID="123456123456123"
APP_SECRET="123abc123abc123abc123abc123abc12"
@bzhr
bzhr / gist:788c91e77b942052817d21ea7be68372
Created May 16, 2017 16:21 — forked from mbrochh/gist:964057
Fast Forward Your Fork
# kudos to https://github.com/drewlesueur
# stolen from here: https://github.com/blog/266-fast-forward-your-fork#comment-11535
git checkout -b upstream-master
git remote add upstream git://github.com/documentcloud/underscore.git
git pull upstream master
git checkout master // [my master branch]
git merge upstream-master
git push origin master
@bzhr
bzhr / install_elixir.md
Created May 16, 2017 14:54 — forked from rubencaro/install_elixir.md
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.