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
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x7000000E1}, {"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}' | |
cat << 'EOF' > ~/.keymappings && chmod +x ~/.keymappings | |
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x7000000E1}, {"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}' | |
EOF | |
sudo /usr/bin/env bash -c "cat > /Library/LaunchDaemons/org.custom.keymappings.plist" << EOF | |
<?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"> |
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 React from 'react' | |
const bgStyles = { | |
strokeWidth: 3, | |
strokeLinejoin: 'round', | |
strokeLinecap: 'round', | |
fill: 'none', | |
stroke: '#c3fdff' | |
} |
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
/** | |
* Expose `Batch`. | |
*/ | |
module.exports = Batch; | |
/** | |
* Create a new Batch. | |
*/ |
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
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
/* | |
* Consume whitespace. | |
*/ | |
#define WHITESPACE \ |
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
// grab time spent | |
sum := Agg("duration_sum", Sum("duration")) | |
// grab time spent per label | |
labels := Agg("labels", | |
Terms("issue.labels.keyword", 100), | |
Aggs(sum)) | |
// grab time spent per day, and per label |
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
/** | |
* Module dependencies. | |
*/ | |
var fs = require('fs'); | |
var css = fs.readFileSync('style.css', 'utf8'); | |
function scan(buf) { |
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
function FunctionBind(this_arg) { // Length is 1. | |
if (!IS_FUNCTION(this)) { | |
throw new $TypeError('Bind must be called on a function'); | |
} | |
// this_arg is not an argument that should be bound. | |
var argc_bound = (%_ArgumentsLength() || 1) - 1; | |
if (argc_bound > 0) { | |
var bound_args = new $Array(argc_bound); | |
for(var i = 0; i < argc_bound; i++) { | |
bound_args[i] = %_Arguments(i+1); |
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
function InstantiateFunction(data, name) { | |
// We need a reference to kApiFunctionCache in the stack frame | |
// if we need to bail out from a stack overflow. | |
var cache = kApiFunctionCache; | |
var serialNumber = %GetTemplateField(data, kApiSerialNumberOffset); | |
var isFunctionCached = | |
(serialNumber in cache) && (cache[serialNumber] != kUninitialized); | |
if (!isFunctionCached) { | |
try { | |
cache[serialNumber] = null; |
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
obj = { | |
a : function(){ | |
print('im a') | |
}, | |
b : function(){ | |
var self = this | |
print('im b') | |
function c(){ | |
self.a() |
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
package main | |
import "github.com/segmentio/rpc" | |
import "fmt" | |
type Args struct { | |
A int | |
B int | |
} |