Skip to content

Instantly share code, notes, and snippets.

@fndari
fndari / README.md
Last active October 11, 2020 02:25
Fix slow ethernet adapter speed on Linux

Fix slow ethernet adapter speed on Linux

Tested for:

  • Ubuntu 18.04/20.04
  • Lenovo X1 Carbon 6th gen ethernet dongle
  1. Download check-eth.sh to a directory on your $PATH, e.g. ~/.local/bin
  2. Make it executable with chmod +x ~/.local/bin/check-eth.sh
  3. Download check-eth.desktop to ~/.local/share/applications
@fndari
fndari / environment.yml
Created February 21, 2019 21:16
Testing Binder with Gist
dependencies:
- python>=3.6
- pandas
@fndari
fndari / distances.ipynb
Created September 15, 2018 02:29
Example using the OpenRouteService (ORS) API
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fndari
fndari / keybase.md
Created September 4, 2018 23:41
keybase.io verification

Keybase proof

I hereby claim:

  • I am fndari on github.
  • I am fndari (https://keybase.io/fndari) on keybase.
  • I have a public key whose fingerprint is 3BFB 6FAE 2BE8 D881 9D5E 54D0 974F EA65 3DDB DFFB

To claim this, I am signing this object:

@fndari
fndari / rootpy_patches.py
Created January 29, 2018 14:45
Monkeypatching `rootpy.BaseFunction.__getitem__()`
# from rootpy import *
from rootpy.plotting.func import BaseFunction
def getitem_patched(self, value):
# using `str` instead of `basestring` with py3
# use six.string_types for py2 compatibility
if isinstance(value, str):
idx = self.GetParNumber(value)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python3
from tinydb import TinyDB
from tinydb.storages import Storage, touch
import yaml
class TestYamlStorage1(Storage):
"""
Store the data in a YAML file.
@fndari
fndari / readfile.cxx
Last active December 17, 2015 10:41
Basic read and write with ASCII files with C++
#include <fstream>
#include <iostream>
struct Parameters
{
float a;
float b;
float c;
};
@fndari
fndari / setCustomStyle.C
Created April 30, 2014 08:40
Some of the stuff I'm trying to make working with ROOT a marginally less painful experience.
void setCustomStyle()
{
TStyle* customStyle = new TStyle("customStyle", "customStyle");
customStyle->SetDrawBorder(0);
customStyle->SetCanvasBorderMode(0);
customStyle->SetFrameBorderMode(0);
customStyle->SetPadBorderMode(0);
customStyle->SetPalette(1,0); // avoid horrible default color scheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Indentation Rules</string>
<key>scope</key>
<string>text.tex, sources.bib</string>
<key>settings</key>
<dict>