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 | |
FILES=`git ls-tree --name-only HEAD .` | |
MAXLEN=0 | |
IFS=$(echo -en "\n\b") | |
for f in $FILES; do | |
if [ ${#f} -gt $MAXLEN ]; then | |
MAXLEN=${#f} | |
fi | |
done |
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 Photos | |
import MobileCoreServices | |
class AssetPicker: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate, UIDocumentPickerDelegate, UIDocumentMenuDelegate { | |
static let sharedInstance = AssetPicker() | |
private lazy var cameraPicker: UIImagePickerController = { | |
let cameraPicker = UIImagePickerController() |
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 org.bouncycastle.openpgp.{ | |
PGPPublicKeyRing, | |
PGPPublicKeyRingCollection, | |
PGPUtil, | |
} | |
import org.bouncycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator | |
def readPGPPublicKeys(pubKeys: List[String]): PGPPublicKeyRingCollection = { | |
val fingerprintCalculator = new JcaKeyFingerprintCalculator() | |
val publicKeyRings = pubKeys.map { pubKey => |
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
/* @flow */ | |
// A simplified representation of types using phantom types (so that we store the Type information both at value and type level) | |
class Type<T> {}; | |
class StringT extends Type<string> {} | |
class NumberT extends Type<number> {} | |
// A schema for a User | |
const User = { | |
name: new StringT(), |
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
\documentclass{article} | |
\title{LaTeX is now Sublime} | |
\author{Gabriele Petronella} | |
\begin{document} | |
\maketitle | |
\section{My first section} |
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
\documentclass{article} | |
\title{A long document} | |
\author{Gabriele Petronella} | |
\date{\today} | |
\begin{document} | |
\maketitle |
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
'use strict'; | |
// The module 'vscode' contains the VS Code extensibility API | |
// Import the module and reference it with the alias vscode in your code below | |
import { window, commands, ExtensionContext, Range, Position, TextEditor, workspace, DecorationOptions } from 'vscode'; | |
const decorationType = window.createTextEditorDecorationType({ }) | |
function addDecorations(e: TextEditor) { | |
try { |
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 docs | |
import mdoc.Reporter | |
import mdoc.StringModifier | |
import scala.meta.inputs.Input | |
import java.util.UUID | |
/** Transforms scala code blocks into Scastie snippets | |
* | |
* ==Usage== |
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
export default function (babel) { | |
const { types: t } = babel; | |
return { | |
visitor: { | |
NumericLiteral(path) { | |
path.node.value += 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
export default function(context) { | |
return { | |
CallExpression(node) { | |
const { callee } = node; | |
if (callee.type === "MemberExpression" && callee.object.name === "console" && callee.property.name === "log") { | |
context.report(node, "Do not use console.log"); | |
} | |
} | |
}; | |
} |
NewerOlder