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 ...
{
"name": "zimble",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
@bzhr
bzhr / index.js
Created May 14, 2020 16:45
Apollo Refresh Token
import React from "react";
import ReactDOM from "react-dom";
import ApolloClient from "apollo-client";
import { ApolloProvider } from "@apollo/react-hooks";
import { ApolloLink, fromPromise } from "apollo-link";
import { onError } from "apollo-link-error";
// import "./index.css";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import { createUploadLink } from "apollo-upload-client";
import React from "react";
import ReactDOM from "react-dom";
import ApolloClient from "apollo-client";
import { ApolloProvider } from "@apollo/react-hooks";
import { ApolloLink, fromPromise, Observable } from "apollo-link";
import { onError } from "apollo-link-error";
// import "./index.css";
import App from "./App";
import * as serviceWorker from "./serviceWorker";
import { createUploadLink } from "apollo-upload-client";
Hereby I declare that the Instagram app bozho_bot won't invalidate anyone's privacy on the Instagram platform.
It is only used to automate some repetitive tasks for managing my account.
@bzhr
bzhr / Helpers
Last active September 26, 2018 11:11
# Start MongoDB
`sudo systemctl start mongod`
# Check if MongoDB is running
`sudo systemctl status mongod`
# More info
https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04
# Mount QNap NAS Folder to Ubuntu
Example:
sudo mount -t nfs sai.local:/Public /mnt/nas/Public
@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"
JS tools
1. nvm is updated by installing the latest version (it overwrites the previous). With nvm you can switch from more than one version of node.
2. Node is managed with nvm.
3. Npm is managed with node. To update run `npm install npm@latest -g`.