This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////////////////////////////////// | |
// Copied from http://www.alecjacobson.com/weblog/?p=3816 | |
///////////////////////////////////////////////////////// | |
#import <Foundation/Foundation.h> | |
#import <Cocoa/Cocoa.h> | |
#import <unistd.h> | |
BOOL copy_to_clipboard(NSString *path) | |
{ | |
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage | |
NSImage * image; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pcbnew | |
import math | |
# Based upon https://bit.ly/3agYp7f by Greg Davill (@GregDavill on Twitter) | |
# | |
# To use this with KiCAD 6.x.x: | |
# 1. Save this script in KiCAD's "scripting/plugins" directory as "arrange.py" | |
# 2. Open your PCB and refresh plugins by navigating to | |
# Tools > External Plugins > Refresh Plugins | |
# 3. Open the scripting console (Tools > Scripting Console) and execute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let hkTypes:Set<HKObjectType> = [ | |
// body measurements | |
HKObjectType.quantityType(forIdentifier: .bodyMassIndex)!, | |
HKObjectType.quantityType(forIdentifier: .bodyFatPercentage)!, | |
HKObjectType.quantityType(forIdentifier: .height)!, | |
HKObjectType.quantityType(forIdentifier: .bodyMass)!, | |
HKObjectType.quantityType(forIdentifier: .leanBodyMass)!, | |
// fitness identifiers | |
HKObjectType.quantityType(forIdentifier: .stepCount)!, | |
HKObjectType.quantityType(forIdentifier: .distanceWalkingRunning)!, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rest_client' | |
require 'json' | |
class RescueTimeProfile | |
API_BASE_URL = 'https://www.rescuetime.com/anapi' | |
TIME_SCORE_SCALE = { | |
2 => 1, | |
1 => 0.75, | |
0 => 0.50, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import markdown | |
from markdown_include.include import MarkdownInclude | |
import weasyprint | |
from mako.template import Template | |
HTML_BOILERPLATE_TEMPLATE = """ | |
<html> | |
<head> | |
<style>{css}</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:16.04 | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
g++ \ | |
make \ | |
file \ | |
curl \ | |
ca-certificates \ | |
python2.7 \ | |
git \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Proc | |
def call_with_vars(vars, *args) | |
Struct.new(*vars.keys).new(*vars.values).instance_exec(*args, &self) | |
end | |
end | |
module Touchy | |
class GuardError < Exception; end | |
class GuardSignatureError < GuardError; end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.js-moments-tab { | |
display: none !important; | |
} | |
.wtf-module { | |
display: none !important; | |
} | |
.LiveVideoHomePageModuleContainer { | |
display: none !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// lmutracker.mm -- Provides lux measurement using MacBook Ambient Light Sensor | |
// | |
// clang -o lmutracker lmutracker.mm -framework IOKit -framework CoreFoundation | |
// | |
// Adaptation of code originally posted at https://bugzilla.mozilla.org/show_bug.cgi?id=793728 | |
// by Reuben Morais. Modified by Ken Keiter <ken@kenkeiter.com> to output a single *lux* value | |
// and exit, rather than repeating measurements on the sensor's arbitrary scale. | |
#include <mach/mach.h> | |
#include <math.h> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder