Skip to content

Instantly share code, notes, and snippets.

Doug Ilijev dilijev

Block or report user

Report or block dilijev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dilijev
dilijev / color_test.sh
Created Jun 22, 2017 — forked from esundahl/color_test.sh
Bash Color Test
View color_test.sh
function color_test {
# Daniel Crisman's ANSI color chart script from
# The Bash Prompt HOWTO: 6.1. Colours
# http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
#
# This function echoes a bunch of color codes to the
# terminal to demonstrate what's available. Each
# line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a
# test use of that color on all nine background
View __tc39-logs-trim.js
// Remove non-chat log lines from e.g. http://logs.libuv.org/tc39/latest
// paste in debugger console and run, or see _bookmarklet.md for a URL you can add to your favorites bar for the same.
(function () {
function remove(name) {
let elems = document.getElementsByClassName(name);
do {
let e = elems[0];
if (!e) break;
let parent = elems[0].parentNode;
parent.removeChild(e);
@dilijev
dilijev / js-host-bin-sources.md
Last active May 31, 2017
Easily set up eshost-cli with public binaries of various JS hosts
View js-host-bin-sources.md

This Gist contains sources and instructions for setting up eshost-cli without needing to build anything. (However, some information about where to get sources and how to build is included, if you are so inclined.)

Get eshost-cli

  • npm install -g eshost-cli
  • Run as eshost

(See also eshost)

@dilijev
dilijev / repro.md
Last active Mar 10, 2016
Undefined URLs in navigation
View repro.md

Affects:

  • Edge 25.10586.0.0 and IE on Windows 10 (Version 1511 (OS Build 10586.104)).
  • No repro in Chrome 48
  • No repro in Firefox 44

Repro steps:

  1. Start at URL from list below, e.g.: https://github.com/defunkt/jquery-pjax
  2. Click script directory (or click CONTRIBUTING.md file, etc.)
@dilijev
dilijev / filetypes.sh
Last active Mar 2, 2016
Bash one-liner to find all filetypes in a git repo
View filetypes.sh
git ls-files | grep -P '\/[^\/\.]*\.[^\/\.]+$' | sed -r 's/.*\.([^\/\.]+)$/\1/g' | sort | uniq
@dilijev
dilijev / ansi.cmd
Last active Feb 20, 2016
Demonstrating ANSI color sequences on Windows.
View ansi.cmd
REM the following sets bold red text on grey background, prints ' hello ' and then resets the colors afterwards.
@echo  hello 
@dilijev
dilijev / renamer.py
Created Sep 13, 2014
Python Batch File Renamer
View renamer.py
import re, glob, os
def renamer(files, pattern, replacement):
for pathname in glob.glob(files):
basename= os.path.basename(pathname)
new_filename= re.sub(pattern, replacement, basename)
if new_filename != basename:
os.rename(
pathname,
os.path.join(os.path.dirname(pathname), new_filename))
@dilijev
dilijev / gist:4576361
Created Jan 20, 2013
Indent open braces, code on the same line as the open brace, further indenting the block, LISP style "if ... else if ... else" hanging indents. I don't even....
View gist:4576361
TOKEN gettoken()
{ int c, cclass;
TOKEN tok = (TOKEN) talloc(); /* = new token */
skipblanks(); /* and comments */
if ((c = peekchar()) != EOF)
{
cclass = CHARCLASS[c];
if (cclass == ALPHA)
identifier(tok);
else if (cclass == NUMERIC)
View matrix.cpp
/**
Compile with
g++ matrix.cpp -o matrix
Run with
./matrix
*/
View DimensionException.cpp
class DimensionException : public std::exception {
private:
size_type _rowsA;
size_type _colsA;
size_type _rowsB;
size_type _colsB;
char _what[256];
public:
DimensionException()
: exception() {
You can’t perform that action at this time.