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:
// code originally adapted from https://github.com/DuncanMC/SwiftPerformanceBenchmark | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <CoreFoundation/CFDate.h> | |
void updateTotal(int newTotal, CFAbsoluteTime startTime) { | |
CFAbsoluteTime now = CFAbsoluteTimeGetCurrent(); | |
CFAbsoluteTime totalTime = now - startTime; |
#config/initializers/redis.rb | |
require 'redis' | |
require 'redis/objects' | |
REDIS_CONFIG = YAML.load( File.open( Rails.root.join("config/redis.yml") ) ).symbolize_keys | |
dflt = REDIS_CONFIG[:default].symbolize_keys | |
cnfg = dflt.merge(REDIS_CONFIG[Rails.env.to_sym].symbolize_keys) if REDIS_CONFIG[Rails.env.to_sym] | |
$redis = Redis.new(cnfg) | |
Redis::Objects.redis = $redis |
# 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 |
I hereby claim:
To claim this, I am signing this object:
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
require 'colorize' | |
puts "\n" | |
3.times do | |
String.colors.each do |color| | |
print ' '.colorize(color: :default, background: color) | |
print ' ' | |
end | |
puts '' | |
end |
{ | |
"command": "watch", | |
"suppressTaskName": true, | |
"tasks": [{ | |
"taskName": "watch", | |
"command": "rbenv", | |
"args": ["exec", "bundle", "exec", "guard", "--no-interactions"], | |
"isBackground": true, | |
"problemMatcher": { | |
"applyTo": "allDocuments", |
module ObjectExtensions | |
def methods | |
return super - Object.methods unless self == Object | |
super | |
end | |
end | |
class Object | |
prepend ObjectExtensions | |
end |
# 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 |
<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({ |