Skip to content

Instantly share code, notes, and snippets.

View kenfehling's full-sized avatar
:octocat:

Ken Fehling kenfehling

:octocat:
View GitHub Profile
@ryanmaclean
ryanmaclean / create-win10-usb-on-mac.sh
Last active November 17, 2024 05:45 — forked from bmatcuk/create-usb.sh
Create a Bootable UEFI Windows USB stick from an ISO on Apple macOS
# Just a quick update for GPT and to use `rsync` instead of `cp`!
# That means this applies to UEFI boot, though for legacy BIOD boot, feel free to swap
# GPT to MBR below.
# Requires https://homebrew.sh to split the install.wim file
brew install wimlib
# First, we need to find our device. BEFORE inserting your USB drive, run the
# following:
diskutil list
@gmolveau
gmolveau / firefox_dark_background.md
Last active January 31, 2025 23:07
Firefox dark background / theme for new tab and loading screen

Firefox Dark Background

  • How to change the background on Firefox to a dark one on new tab / loading screen ?

Procedure

  • Type about:config in the URL bar
  • Search toolkit.legacyUserProfileCustomizations.stylesheets and double-click the field to set it to true
  • Type about:support in the URL bar
  • Look for Profile folder field and click on the open button next to it.
@Stonesjtu
Stonesjtu / mem_report.py
Last active March 7, 2023 16:58
A simple Pytorch memory usages profiler
import gc
import torch
## MEM utils ##
def mem_report():
'''Report the memory usage of the tensor.storage in pytorch
Both on CPUs and GPUs are reported'''
def _mem_report(tensors, mem_type):
@metacritical
metacritical / slurp.clj
Created October 30, 2017 01:37 — forked from noprompt/slurp.clj
How to use slurp from ClojureScript
(ns foo.core
(:refer-clojure :exclude [slurp]))
(defmacro slurp [file]
(clojure.core/slurp file))
;; In CLJS
(ns bar.core
(:require [foo.core :include-macros true :refer [slurp]]))

LI Web Pluralsight Study Group

About

A study group where developers gather on a bi-weekly basis to watch, discuss and learn from Pluralsight's vast library of training.

Format

The group will choose a Pluralsight course to watch and it will get broken down into approximately one hour segments.

@ccnokes
ccnokes / axios-instance-config.js
Created July 6, 2017 16:23
Good default configuration for axios in node.js
const axios = require('axios');
const http = require('http');
const https = require('https');
module.exports = axios.create({
//60 sec timeout
timeout: 60000,
//keepAlive pools and reuses TCP connections, so it's faster
httpAgent: new http.Agent({ keepAlive: true }),
@jakebrinkmann
jakebrinkmann / connect_psycopg2_to_pandas.py
Created July 3, 2017 14:19
Read SQL query from psycopg2 into pandas dataframe
import pandas as pd
import pandas.io.sql as sqlio
import psycopg2
conn = psycopg2.connect("host='{}' port={} dbname='{}' user={} password={}".format(host, port, dbname, username, pwd))
sql = "select count(*) from table;"
dat = sqlio.read_sql_query(sql, conn)
conn = None
@Brainiarc7
Brainiarc7 / build-tensorflow-from-source.md
Last active September 9, 2024 22:48
Build Tensorflow from source, for better performance on Ubuntu.

Building Tensorflow from source on Ubuntu 16.04LTS for maximum performance:

TensorFlow is now distributed under an Apache v2 open source license on GitHub.

On Ubuntu 16.04LTS+:

Step 1. Install NVIDIA CUDA:

To use TensorFlow with NVIDIA GPUs, the first step is to install the CUDA Toolkit as shown:

@lebedov
lebedov / cat_half.py
Created February 23, 2017 15:10
Algorithm for concatenating half precision pytorch tensors.
#!/usr/bin/env python
"""
Algorithm for concatenating half precision tensors by allocating new output matrix
of appropriate size and copying each of the constituent tensors into it with
appropriate offsets.
"""
import numpy as np
import torch
const stuff = [
{ path: '/one', label: 'One' },
{ path: '/two', label: 'Two' },
{ path: '/three', label: 'Three' },
{ path: '/four', label: 'Four' }
]
class Item extends Component {
render() {
const { pathname='', isRoot, parentLocation } = this.props