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
/** | |
* Don't let your headers dangle! | |
* | |
* My super cool blog | |
* thing <<<< dangling! | |
*/ | |
function noDangle(selector, minWords) { | |
selector = selector || 'h1,h2,h3,h4,h5,h6' | |
minWords = minWords || 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! GithubLink() | |
let remote = system("git remote -v | sed -n '1 p' | awk '{print $2}'") | |
let remote = substitute(remote, ".git\n", "", "") | |
let line = line(".") | |
let fname = expand("%@") | |
let linestr = "#L" . line | |
if line == 1 | |
let linestr = '' | |
endif |
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
/** | |
* Redux async helpers. | |
*/ | |
// Constants | |
const REQUEST = 'request'; | |
const SUCCESS = 'succces'; | |
const FAILURE = 'failure'; | |
/** Request status can only be one of these: */ |
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
/*! track-focus v 1.0.0 | Author: Jeremy Fields [jeremy.fields@vget.com], 2015 | License: MIT */ | |
// inspired by: http://irama.org/pkg/keyboard-focus-0.3/jquery.keyboard-focus.js | |
/** | |
* Tracks an element is focused via the mouse or keyboard. On mouse focus, adds | |
* the mouseClass to the element. | |
* | |
* Adapted from: https://github.com/ten1seven/track-focus/blob/master/src/javascripts/track-focus.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
const isWhitespace = (char) => | |
char === ' ' || char === '\n' || char === '\t' || char === '\r'; | |
const isParen = (char) => char === '(' || char === ')'; | |
const getLiteralType = (literal) => { | |
if (literal[0] === '"' && literal[literal.length - 1] === '"') { | |
return 'string'; | |
} |
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 "deps/glfw/include/GLFW/glfw3.h" | |
#include <stdio.h> | |
void shader_print_errors(GLuint id) { | |
GLint success; | |
glGetShaderiv(id, GL_COMPILE_STATUS, &success); | |
if (!success) { | |
GLchar infoLog[1024]; | |
glGetShaderInfoLog(id, 1024, NULL, infoLog); |
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
// Converts SQL query from named parameters :param to [param] | |
export const sqlParams = ( | |
sql: string, | |
params: Record<string, any> | |
): [string, any[]] => { | |
const matches = sql.split(/([^:]:[A-z]+[A-z0-9])/g); | |
let i = 0; | |
const nextParams: any[] = []; | |
const nextSql = matches.map((str, index) => { |
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
<a><b><c><d><style>*{background:#09042a}body *{position:fixed;padding:30;border-radius:50%;border:10px solid #09042a;margin:14 19}a{margin:104 90;box-shadow:4em 0 #e78481}c{margin:-146 -38}b,c{background:#f5bb9c}a,d{border-color:#e78481 |
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
int main() { | |
char *path = "/path/to/my/directory"; | |
print("watching %s for changes...\n", path); | |
HANDLE file = CreateFile(path, | |
FILE_LIST_DIRECTORY, | |
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, | |
NULL, | |
OPEN_EXISTING, | |
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, |
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> | |
<meta charset=utf-8> | |
<meta name="viewport" content="minimal-ui, width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="mobile-web-app-capable" content="yes"> | |
<title></title> | |
<meta name="description" content=""> |
OlderNewer