- Two spaces to indent. Be anal about this.
- Write code in English.
- Code must work.
- Code must be easy to understand.
- Critical code should be efficient.
- Use standardrb, a minimal, opinionated ruby formatter with a sane default config. Make sure everyone is using it from the beginning.
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
javascript:(()=>{ | |
const relativeTimes = document.querySelectorAll('relative-time[format="relative"], relative-time:not([format])'); | |
if (relativeTimes.length > 0) { | |
for (let elem of relativeTimes) { | |
elem.setAttribute('data-old-config', JSON.stringify({ | |
format: elem.getAttribute('format'), | |
hour: elem.getAttribute('hour'), | |
minute: elem.getAttribute('minute') | |
})); | |
elem.setAttribute('format', 'datetime'); |
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 ( | |
"fmt" | |
"encoding/json" | |
"github.com/slack-go/slack" | |
) |
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
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
require 'csv' | |
MATCHER = /\Adata\/(?<deg>\d+)\/(?<bug>L\d)\.txt\z/.freeze | |
files = Hash.new { |h, k| h[k] = Hash.new } | |
Dir['data/*/*.txt'].each do |s| |
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 diagnolWinner() { | |
var color; | |
for (var i = 0; i <= board.length - 4; i++) { | |
if ((color = genericDiagnol(i, 1)) !== 0) { | |
return color; | |
} | |
} | |
for (var i = board.length - 1; i >= board.length - 4; i--) { | |
if ((color = genericDiagnol(i, -1)) !== 0) { | |
return color; |
I hereby claim:
- I am R167 on github.
- I am wmdurand (https://keybase.io/wmdurand) on keybase.
- I have a public key whose fingerprint is 4A38 5B71 4B0A FA8E 6CC1 8BFF D157 8D5F 36A8 6B41
To claim this, I am signing this object:
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
public class Car extends SteeringVehicle { | |
// write all methods required | |
} |
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
<!DOCTYPE html> | |
<!-- | |
- Full screen clock (24-hour with seconds) | |
- Copyright (c) 2015 Project Nayuki | |
- | |
- http://www.nayuki.io/page/full-screen-clock-javascript | |
--> | |
<html style="display:block; height:100%; margin:0; padding:0"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
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
// AP-1 => copyEndy | |
// passed | |
public int[] copyEndy(int[] nums, int count) { | |
int[] ret = new int[count]; | |
int curr = 0; | |
for (int i = 0; i < nums.length && curr < count; i++) { | |
if ((nums[i] <= 10 && nums[i] >= 0) || (nums[i] <= 100 && nums[i] >= 90)) { | |
ret[curr] = nums[i]; | |
curr += 1; |