Skip to content

Instantly share code, notes, and snippets.

View lopugit's full-sized avatar

Nikolaj lopugit

View GitHub Profile
@lopugit
lopugit / 1_primitive_comparison.js
Created May 5, 2019 02:37 — forked from nicbell/1_primitive_comparison.js
JavaScript object deep comparison. Comparing x === y, where x and y are values, return true or false. Comparing x === y, where x and y are objects, returns true if x and y refer to the same object. Otherwise, returns false even if the objects appear identical. Here is a solution to check if two objects are the same.
//Primitive Type Comparison
var a = 1;
var b = 1;
var c = a;
console.log(a == b); //true
console.log(a === b); //true
console.log(a == c); //true
console.log(a === c); //true
@lopugit
lopugit / bugs global factory
Created February 20, 2019 12:46
bugs global factory
(function (globalThis, factory) {
if (typeof exports === 'object' && typeof module !== 'undefined')
if (typeof global === 'object')
return factory(global)
else
return factory(exports)
if (typeof define === 'function' && define.amd)
return define(['exports'], factory)
@lopugit
lopugit / eslint bugs
Created February 11, 2019 07:44
eslint bugs
{
"env": {
"es6": true, // Use ES6 recommended
"node": true, // We code in node
"browser": true // We also code for browser
},
//"parser": "babel-eslint",
"extends": "eslint:recommended", // Use the recommended ESlint rules
"parserOptions": {
@lopugit
lopugit / drive-format-ubuntu.md
Created January 12, 2019 14:50 — forked from keithmorris/drive-format-ubuntu.md
Partition, format, and mount a drive on Ubuntu
@lopugit
lopugit / Isomorphic Fetch post body data empty solution
Last active October 3, 2018 23:07
Isomorphic Fetch post body data empty solution
Client:
fetching with headers:
{ "Content-Type": "application/json" }
Stringifying JSON:
body: JSON.stringify(data)
Server: add:
app.use((req, res, next) => {
res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
@lopugit
lopugit / config.hpp
Created September 22, 2018 20:57
wenode.config
/*
* Copyright (c) 2016 WeYouMe Network., and contributors.
*/
#pragma once
#define BLOCKCHAIN_VERSION ( version(0, 19, 5) )
#define BLOCKCHAIN_HARDFORK_VERSION ( hardfork_version( BLOCKCHAIN_VERSION ) )
#ifndef SHOW_PRIVATE_KEYS
#define SHOW_PRIVATE_KEYS 1
@lopugit
lopugit / twym.accounts.webuilder.json
Last active September 22, 2018 20:57
twym.accounts.webuilder
{
"id": 3,
"name": "webuilder",
"owner": {
"weight_threshold": 1,
"account_auths": [],
"key_auths": [[
"TWYM7GXFkFDNkweQJHhegS1iX5vg1oEouAhZ5EZZR34cYUxQvHFii5",
1
]
@lopugit
lopugit / gist:9691bd72524c5d6fbc97bd32db350069
Created September 22, 2018 07:54
auto connect synergy to any list of ip addresses synergy listening server
#!/bin/bash
# IP address to cycle through (in order of priority)
ip=( "192.168.20.102" "192.168.20.103" )
# Check if synergy is already connected
if pgrep "synergyc"; then
# Synergy already connected
echo "Synergy is already running."
else
@lopugit
lopugit / ImportError: No module named cryptography.hazmat.bindings.openssl.binding
Created September 6, 2018 13:12
ImportError: No module named cryptography.hazmat.bindings.openssl.binding fix solution aws linux certbot
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/cryptography /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/cryptography
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/cffi /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/cffi
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/cffi-1.10.0.dist-info /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/cffi-1.10.0.dist-info
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/_cffi_backend.so /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/_cffi_backend.so
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/.libs_cffi_backend /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/.libs_cffi_backend
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/zope.interface-4.1.3-py2.7-nspkg.pth /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope.interface-4.1.3-py2.7-nspkg.pth
ln -s /opt/eff.org/certbot/ven
@lopugit
lopugit / gist:21f5b55e0eb656c1d4dccccf89ec8310
Last active February 11, 2022 20:28
Setting the Mac hostname or computer name from the terminal
Summary
This article provides instructions on setting the hostname of a Mac OS X workstation from the terminal.
This can be useful when configuring your workstation remotely through ssh, or when you need to change the fully qualified hostname of the workstation (which can't be done from the UI).
Note: The following procedure is for informational purposes only and is not an Autodesk certified or supported workflow. Should issues arise with this procedure, they will not be addressed by Autodesk Customer Support.
Procedure
Perform the following tasks to change the workstation hostname using the scutil command.
Open a terminal.