Skip to content

Instantly share code, notes, and snippets.

View PoisonousJohn's full-sized avatar

Ivan Fateev PoisonousJohn

View GitHub Profile
@PoisonousJohn
PoisonousJohn / 77-modem-managers-arduino-leonardo.rules
Created February 11, 2017 14:53
Fixing serial port on ArcBotics Sparky / put under /etc/udev/rules
#
# adapted from freetronics by laurent mardi 11/08/2015
# from : http://www.freetronics.com.au/pages/leostick-getting-started-guide#linux_uploading
#
#-----------------------------------------------
# disable modem manager for usb arduino leonardo
#-----------------------------------------------
# new linux version check for modem after plug an usb cdc device
# this take time and after disable the cdc serial port.
#
@PoisonousJohn
PoisonousJohn / visualstudiocode.sh
Created February 18, 2017 14:22 — forked from ted-piotrowski/visualstudiocode.sh
Visual Studio Code on ARM Debian Linux
# building Visual Studio Code Debian package on ARM
# get source code
git clone [email protected]:Microsoft/vscode.git
cd vscode
# build debian package
./scripts/npm.sh install --arch=armhf
./node_modules/.bin/gulp vscode-linux-arm-build-deb
@PoisonousJohn
PoisonousJohn / nodejs.sh
Created February 18, 2017 19:06 — forked from ted-piotrowski/nodejs.sh
Install latest NodeJS on Ubuntu ARM
sudo apt-get uninstall nodejs # uninstall nodejs 4.2.6
wget https://nodejs.org/dist/v6.6.0/node-v6.6.0-linux-armv7l.tar.gz # get latest ARM build
tar -xvf node-v6.6.0-linux-armv7l.tar.gz # extract it
sudo cp node-v6.6.0-linux-armv7l /etc/node6.6 # copy extracted file to /etc folder
sudo ln -s /etc/node6.6/bin/node /usr/bin/node # link the nodejs executable
sudo ln -s /etc/node6.6/bin/npm /usr/bin/npm # link the npm executable
node --version # should output v6.6.0
@PoisonousJohn
PoisonousJohn / Example.cs
Created March 21, 2017 07:29 — forked from JohannesEH/Example.cs
How to make a non-nullable type wrapper in C#, today… (doesn't work, for blog)
public void DoStuff(object input)
{
if (input == null)
throw new ArgumentNullException("input");
// Method implementation...
}
@PoisonousJohn
PoisonousJohn / AppCrash.qml
Last active April 28, 2017 12:42
Causing a crash on qt 5.8
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
{
"swagger": "2.0",
"info": {
"version": "v1",
"title": "Leaderboard API"
},
"basePath": "/",
"paths": {
"/api/Values": {
"get": {
@PoisonousJohn
PoisonousJohn / function.json
Created December 15, 2017 13:43
Template for publishing precompiled azure function
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.0.0",
"configurationSource": "attributes",
"bindings": [
{
"type": "eventHubTrigger",
"path": "default",
"connection": "EventHub",
"name": "myEventHubMessage"
}
@PoisonousJohn
PoisonousJohn / Sample.cs
Created February 20, 2018 11:49
Code sample
using System.Console;
public class Test
{
public Test()
{
Console.WriteLine("Let's test it");
}
}
@PoisonousJohn
PoisonousJohn / Coupling.cs
Created February 20, 2018 14:27
Coupling sample
using System;
public class Logger
{
public void Info(string msg)
{
Console.WriteLine(msg);
}
}
@PoisonousJohn
PoisonousJohn / Services.cs
Last active February 20, 2018 16:03
Example of static-class locator anti-pattern
public static class Services
{
public static AdService ads { get; set; }
public static APIService api { get; set; }
// tons of other services
public static AnalyticsService analytics { get; set; }
}
public class Loader : MonoBehaviour {
private void Awake()