Skip to content

Instantly share code, notes, and snippets.

// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "cmd+e",
"command": "workbench.action.quickOpen"
},
{
"key": "cmd+p",
"command": "-workbench.action.quickOpen"
},
package tylerwalker.io.dsl
import android.support.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4
import android.text.SpannableStringBuilder
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
@twalk4821
twalk4821 / DSL
Created July 13, 2019 20:31
Kotlin SpannableStringBuilder DSL
package tylerwalker.io.dsl
import android.graphics.Color
import android.text.Spannable
import android.text.SpannableStringBuilder
import android.text.style.ForegroundColorSpan
class Atom(val content: SpannableStringBuilder) {
operator fun String.unaryPlus() { content.append(this) }
@twalk4821
twalk4821 / datatables-custom-filter-demo.markdown
Last active April 5, 2021 11:51
DataTables Custom Filter Demo
@twalk4821
twalk4821 / CROmetrics.apply
Created July 17, 2017 23:37
Application for CROmetrics remote work
# CROmetrics Engineering Application
Thanks for your interest in working with us! To apply:
- Create a "new gist" (link in github header once you're logged in) with the Raw Text of this .md file (**do not fork this gist**)
- Answer the following questions in the spaces provided
- Send an email to [email protected] and [email protected] that includes:
- A paragraph that tells us a little about yourself and why you are interested in this job
- A link to your Gist
- Your desired hourly rate and general availability
<div class="row">
<div class="box" id="box1"></div>
<div class="box" id="box2"></div>
</div>
<div class="row">
<div class="box" id="box3"></div>
<div class="box" id="box4"></div>
</div>
const LFUcache = (capacity) => {
let box = {}
box.cache = {}
for (var i = 0; i<capacity; i++) {
box[i] = [];
}
box.put = function (k, v) {
if (box.cache.keys.length <capacity) {
if (!(k in cache)) {
var item = [k,v, 0]
var isSubsequence = function(str, sub) {
currentIndex = 0;
for (var i = 0; i<str.length; i++) {
if (str[i] === sub[currentIndex]) {
currentIndex +=1;
}
}
return currentIndex >= sub.length ? true : false;
}
//labels
//subscribe to labels, needs to create a new label with users as properties, or an array of users
//with references to users, or their components
//multiple users need to access the same message bus
//have a handler for updating the data associated with each user
var messageBus = function() {
this.topics = {}
var vowelDoubler = function(arr) {
vowels = {'a':'a', 'i':'i', 'o':'o', 'u':'u', 'e':'e'}
var count = arr.reduce(function (acc, next) {
return next in vowels ? acc++ : acc;
});
console.log(count)
//hard coded count because reduce function doesn't seem to work
count=1;
j = arr.length+count-1;
for (var i=arr.length-1; i>=0; i--) {