This file contains hidden or 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
<template> | |
<div id="app"> | |
<Vuedraggable v-model='dashboardSectionsComponents' @update="handleDashboardSectionsSort"> | |
<!-- NOTE I think we might need to look at example like this, on how to pass dynamic props to dynamic component https://stackoverflow.com/questions/43658481/passing-props-dynamically-to-dynamic-component-in-vuejs?answertab=active#tab-top --> | |
<!-- NOTE but let's use this for now. --> | |
<component | |
v-for="component in dashboardSectionsComponents" | |
:is="component.name" | |
:key="component.id" | |
v-bind="$data" |
This file contains hidden or 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
# https://www.hackerrank.com/challenges/ctci-ransom-note | |
#!/bin/ruby | |
m,n = gets.strip.split(' ') | |
m = m.to_i | |
n = n.to_i | |
magazine = gets.strip.split(' ') | |
ransom = gets.strip.split(' ') | |
def ransom_note(ransom, magazine) |
This file contains hidden or 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
/* | |
Subset | |
In today's challenge we want to implement a function is_subset, which checks if one array is the subset of another. | |
Subset means that the first array is included in the second array. Ignore duplicates. | |
- Example: [1, 2, 3].is_subset([1,2,3,4]) => returns true | |
- Example: [1, 2, 3].is_subset([1,3,4]) => returns false | |
- Example: [1, 1, 2, 3].is_subset([1,2,3]) => returns true |
This file contains hidden or 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
/* Counting Words | |
We found an article on Wikipedia and we decide to save this article as a string | |
and count the occurrence of all the different words in the article. In other words, | |
for a given string we want to know the number of times **each word** appears in the article. | |
> Note: be weary of capitalization. | |
*/ | |
var my_article = |
This file contains hidden or 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 dataSample = { | |
buy: [ "purchase" ], | |
big: [ "great", "large" ], | |
}; | |
function synonyms(data, word) { | |
const result = { | |
word, | |
synonyms: data[word] || [], | |
}; |
This file contains hidden or 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 main | |
import ( | |
"fmt" | |
"strings" | |
) | |
func isPalindrome(str string) bool { | |
var size, count int |
This file contains hidden or 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 main | |
import ( | |
"fmt" | |
) | |
type P struct { | |
g, p int | |
} |
This file contains hidden or 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 handler | |
import ( | |
"io" | |
"net/http" | |
) | |
type Handle struct { | |
Action string | |
Method string |
This file contains hidden or 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 router | |
import ( | |
"net/http" | |
"net/url" | |
"strings" | |
) | |
// Handle h | |
type Handle func(http.ResponseWriter, *http.Request, url.Values) |
This file contains hidden or 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 main | |
import ( | |
"encoding/json" | |
"log" | |
"net/http" | |
"time" | |
"github.com/couchbase/gocb" | |
"github.com/gorilla/mux" |