View merge-upstream.sh
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
#!/bin/bash | |
git status 1>/dev/null || exit 1 | |
git fetch upstream | |
if [ "$?" != "0" ]; then | |
echo >&2 | |
echo "fatal: no upstream remote configured" >&2 | |
ORIGIN=$(git remote -v | grep ^origin | cut -f2 | cut -f1 -d' ' | head -n 1) |
View nano.c
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
// nano.c: writes nanosecond mtime of first arg to console | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <time.h> | |
#define SEC_TO_NANO 1000000000 |
View runner.sh
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
#!/bin/bash | |
# Library which causes a bash script to block until killed, shutting down its | |
# child processes when complete. | |
function _death { | |
echo "killing all subprocesses" 1>&2 | |
pkill -P $$ | |
exit 0 # still need to quit | |
} | |
trap _death SIGINT SIGTERM |
View prepare-images.py
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 python | |
import os | |
import sys | |
SCALES = { | |
1: ['mdpi/', ''], | |
1.5: ['hdpi/'], | |
2: ['xxdpi/', '@2x'], |
View validate-test.html
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> | |
<html> | |
<head> | |
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300italic,400,400italic" rel="stylesheet" type="text/css" /> | |
<style type="text/css"> | |
.formrow { | |
min-height: 32px; | |
line-height: 40px; |
View counterdict.py
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 python3 | |
import collections | |
class counterdict(collections.defaultdict): | |
def __init__(self): | |
collections.defaultdict.__init__(self, counterdict) | |
def __sub__(self, value): | |
"""Upgrade this counter to a number. |
View AsyncHandler.java
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 foo; | |
import android.os.Handler; | |
import android.os.HandlerThread; | |
/** | |
* Subclass of {@link Handler} that does things on some background thread. | |
* | |
* @author Sam Thorogood (sam.thorogood@gmail.com) | |
*/ |
View broadcast.go
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 ( | |
"log" | |
"time" | |
) | |
func main() { | |
c := NewCastGroup() |
View gulpfile.js
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
/* | |
* Copyright 2016 Google Inc. All rights reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
* use this file except in compliance with the License. You may obtain a copy of | |
* the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
View script.js
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() { | |
if (Element.prototype['attachShadow']) { | |
return false; // implemented already | |
} | |
const supported = ['article', 'aside', 'blockquote', 'body', 'div', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'nav', 'p', 'section', 'span']; | |
/** | |
* Implements all the fake methods on Element. | |
*/ |
OlderNewer