Skip to content

Instantly share code, notes, and snippets.

View aih's full-sized avatar

Ari Hershowitz aih

View GitHub Profile
@aih
aih / safe-html.pipe.ts
Created August 23, 2019 21:21 — forked from zomdar/safe-html.pipe.ts
safeHtml pipe
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
@Pipe({
name: 'safeHtml'
})
export class SafeHtmlPipe implements PipeTransform {
constructor(private _sanitizer:DomSanitizer) {}
@aih
aih / gist:a9390fb0ecc11e0711099964b84fd817
Last active November 5, 2018 00:30
Sample bill text with changes (From HR 6)
Sec. 1001. At-risk youth Medicaid protection
(a) In general.—Section 1902 of the Social Security Act (42 U.S.C. 1396a) is amended—
(1) in subsection (a)—
(A) by striking “and” at the end of paragraph (82);
(B) by striking the period at the end of paragraph (83) and inserting “; and”; and
(C) by inserting after paragraph (83) the following new paragraph:
“(84) provide that—
“(A) the State shall not terminate eligibility for medical assistance under the State plan for an individual who is an eligible juvenile (as defined in subsection (nn)(2)) because the juvenile is an inmate of a public institution (as defined in subsection (nn)(3)), but may suspend coverage during the period the juvenile is such an inmate;
“(B) in the case of an individual who is an eligible juvenile described in paragraph (2)(A) of subsection (nn), the State shall, prior to the individual’s release from such a public institution, conduct a redetermination of eligibility for such individual with respect to such medical assistance (without re
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" id="ng-app" ng-app="diffDemo" lang="en-us" class="ng-scope"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">[uib-typeahead-popup].dropdown-menu{display:block;}</style><style type="text/css">.uib-time input{width:50px;}</style><style type="text/css">[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom
@aih
aih / I Kinda Like When You're Cold
Last active February 19, 2018 16:51
Poem by Liel Hershowitz
You're cold then you're hot then
you're cold again and I keep
sinking in to your cold sin.
When you get too
cold I should just Quit
but when you're hot it makes
me feel a hundred days old.
I kinda like when you're
@aih
aih / USLM-to-AKN-generic.xsl
Created October 17, 2017 04:44
An XSL to convert generic USLM to generic AKN, XSL version 1.0
<?xml version="1.0" encoding="UTF-8"?>
<!--
==================================================================
Transformation from generic United States Legislation Model (USLM)
to generic AkomaNtoso (AKN)
Ari Hershowitz Xcential, 2017
==================================================================
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
@aih
aih / gist:2fd3c1d6757d212dd7f390fd806359a2
Last active May 19, 2017 17:04
Get path to selected text
//1. Get selection and base node
var s = window.getSelection()
var b = s.baseNode
//Get the text selected
var selectionString = a.toString()
//Find nearest parent with an id
var parentWId=jQuery(b).closest('[id]')
var parentWIdNode = parentWId[0]
@aih
aih / happy_git_on_osx.md
Created March 10, 2017 20:24 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@aih
aih / permutations.js
Last active January 27, 2017 06:57 — forked from wassname/permutations.js
Combinatorics permutatons and product in javascript using lodash.js (like python's itertools)
/**
* Lodash mixins for combinatorics
* Inspired by python itertools: https://docs.python.org/2.7/library/itertools.html
*
* Usage:
* permutations([0,1,2],2) // [[0,1],[0,2],[1,0],[1,2],[2,0],[2,1]]
* combinations([0,1,2],2) // [[0,1],[0,2],[1,2]]
* combinations_with_replacement([0,1,2],2)// [[0,0],[0,1],[0,2],[1,1],[1,2],[2,2]]
* product([0,1,2],[0,1,2]) // [[0,0],[0,1],[0,2],[1,0],[1,1],[1,2],[2,0],[2,1],[2,2]]
*
@aih
aih / update-bundles.sh
Last active November 17, 2019 06:24 — forked from janlay/update-repos.sh
Update all Vim bundles for Pathogen
#/bin/sh
cd ~/.vim/bundle
for i in `\ls -p -d */`; do
cd "$i"
echo "Updating $i..."
git pull --recurse-submodules | grep -v 'Already up-to-date' | sed 's/^/ /'
[ -f .git/.gitmodules ] && git submodule update | sed 's/^/ /'
cd ..
done
/usr/local/Cellar/macvim/8.0-120/MacVim.app/Contents/Resources/vim/vimrc
~/.vimrc
/usr/local/Cellar/macvim/8.0-120/MacVim.app/Contents/Resources/vim/runtime/ftoff.vim
~/.vim/autoload/pathogen.vim
/usr/local/Cellar/macvim/8.0-120/MacVim.app/Contents/Resources/vim/runtime/syntax/syntax.vim
/usr/local/Cellar/macvim/8.0-120/MacVim.app/Contents/Resources/vim/runtime/syntax/synload.vim
/usr/local/Cellar/macvim/8.0-120/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim
/usr/local/Cellar/macvim/8.0-120/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
~/.vim/bundle/criticmarkup-vim/ftdetect/markdown.vim
~/.vim/bundle/pegjs-vim/ftdetect/pegjs.vim