Skip to content

Instantly share code, notes, and snippets.

View MatthiasWinkelmann's full-sized avatar

Matthias Winkelmann MatthiasWinkelmann

View GitHub Profile
@MatthiasWinkelmann
MatthiasWinkelmann / ramdisk.sh
Created January 24, 2018 16:24 — forked from rxin/ramdisk.sh
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@MatthiasWinkelmann
MatthiasWinkelmann / Tensorflow_Build_GPU.md
Last active May 20, 2019 15:21 — forked from smitshilu/Tensorflow_Build_GPU.md
Tensorflow 1.7 Mac OS Sierra 10.12 GPU Support

Tensorflow

System information

  • OS - Sierra 10.12
  • Tensorflow - 1.7.0
  • Xcode command line tools - 8.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
  • Cmake - 3.11
  • Bazel - 0.11.1
@MatthiasWinkelmann
MatthiasWinkelmann / index.html
Last active July 11, 2017 11:59
Minimal example using the StackExchange API
<html>
<head>
<script type='text/javascript' src='https://api.stackexchange.com/js/2.0/all.js'></script>
<script>
// I was a bit stumped because there wasn\'t a single example of how to actually'
// use the StackExchange JS API. As it turns out, you actually don\'t really use it.
// This SE.init() call may or may not get you higher quotas, and it allows your
// users to authenticate. If you don't need those, you can use the REST API without any
// libraries as shown below in getQuestions();",
SE.init({
@MatthiasWinkelmann
MatthiasWinkelmann / extract.py
Last active March 5, 2024 06:19
Extract PNG images from the cifar-100/cifar-10 pickled dataset
# This extracts png images from the
# packed/pickle'd cifar-100 dataset
# available at http://www.cs.toronto.edu/~kriz/cifar.html
#
# No Rights Reserved/ CC0
# Say thanks @whereismatthi on Twitter if it's useful
#
# probably requires python3
# definitely requires PyPNG: pip3 install pypng
@MatthiasWinkelmann
MatthiasWinkelmann / .pryrc
Created May 19, 2017 04:45
Filter ruby's <Class>.methods to exclude the common ones
module ObjectExtensions
def methods
return super - Object.methods unless self == Object
super
end
end
class Object
prepend ObjectExtensions
end
@MatthiasWinkelmann
MatthiasWinkelmann / tasks.json
Created May 18, 2017 15:21
VSCode (Visual Studio Code) tasks.json configuration for rails guard test runner task
{
"command": "watch",
"suppressTaskName": true,
"tasks": [{
"taskName": "watch",
"command": "rbenv",
"args": ["exec", "bundle", "exec", "guard", "--no-interactions"],
"isBackground": true,
"problemMatcher": {
"applyTo": "allDocuments",
@MatthiasWinkelmann
MatthiasWinkelmann / preview.rb
Created March 16, 2017 21:55
A ruby script to quickly generate one colourful terminal output
require 'colorize'
puts "\n"
3.times do
String.colors.each do |color|
print ' '.colorize(color: :default, background: color)
print ' '
end
puts ''
end
@MatthiasWinkelmann
MatthiasWinkelmann / ... Syncing stylelint and editorconfig.md
Last active July 23, 2023 13:14
Syncing stylelint and editorconfig

Synchronizing .editorconfig and stylelint

Note: See MatanelGordon's comment for an updated approach to do this.

Just a quick how-to to import rules specified in .editorconfig into your stylelint configuration to avoid duplication.

Install the following packages. stylelint-config-standard is just used as an example. Use a different one or your current configuration object.

#> (npm install -g | yarn global add) editorconfig stylelint stylelint-config-standard 

Keybase proof

I hereby claim:

  • I am matthiaswinkelmann on github.
  • I am matthi (https://keybase.io/matthi) on keybase.
  • I have a public key ASC58jvqyXfBdzAYxJyHPiJvb1YR31znPlI9rOD7zXzSOgo

To claim this, I am signing this object:

@MatthiasWinkelmann
MatthiasWinkelmann / beautiful-failure.py
Created May 22, 2016 17:58
An Ansible plugin to format console output
# Save as <folder with your playbook>/callback_plugins/<some name>.py
# Optionally use no_log: True on your playbook/roles/tasks to suppress other output
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import time
import json
import sys