Skip to content

Instantly share code, notes, and snippets.

View anjmao's full-sized avatar

Andžej Maciusovič anjmao

  • CAST AI
  • Lithuania, Vilnius
View GitHub Profile
<pre>
<code class="html">
<ng-select [items]="items"
notFoundText="No results found"
typeToSearchText="Search for github account"
bindLabel="login"
[placeholder]="placeholder"
[multiple]="multiple"
[typeahead]="typeahead"
[(ngModel)]="githubAccount">
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
});
<pre>
<code class="html">
&lt;ng-select [items]="items"
notFoundText="No results found"
typeToSearchText="Search for github account"
bindLabel="login"
[placeholder]="placeholder"
[multiple]="multiple"
[typeahead]="typeahead"
[(ngModel)]="githubAccount"&gt;
<h3>Multiselect example with custom template and typeahead</h3>
<pre>
<code class="html">
&lt;ng-select [items]="items"
notFoundText="No results found"
typeToSearchText="Search for github account"
bindLabel="login"
[placeholder]="placeholder"
[multiple]="multiple"
---html,true
<ng-select [items]="items"
notFoundText="No results found"
typeToSearchText="Search for github account"
bindLabel="login"
[placeholder]="placeholder"
[multiple]="multiple"
[typeahead]="typeahead"
[(ngModel)]="githubAccount">
<ng-template ng-option-tmp let-item="item">
module: {
rules: [
{
test: /\.ts$/,
loader: ['awesome-typescript-loader', 'angular2-template-loader', 'ng-snippets-loader'],
exclude: [/node_modules\/(?!(ng2-.+))/],
},
{
test: /\.(html)$/,
loader: ['raw-loader', 'ng-snippets-loader']
const languages = [
{ id: 1, name: 'Javascript', rating: 9 },
{ id: 1, name: 'Golang', rating: 9 },
{ id: 1, name: 'Python', rating: 8 },
{ id: 1, name: 'Rust', rating: 8 },
{ id: 1, name: 'C#', rating: 7 },
{ id: 1, name: 'Java', rating: 5 }
];
const bestLanguages = languages.filter(x => x.rating > 8).map(x => x.name);
package main
import "fmt"
type Language struct {
ID int
Name string
Rating int
}
package main
import "fmt"
func main() {
languages := []Language{
Language{ID: 1, Name: "Javascript", Rating: 9},
Language{ID: 2, Name: "Golang", Rating: 9},
Language{ID: 3, Name: "Python", Rating: 8},
Language{ID: 4, Name: "Rust", Rating: 8},
@anjmao
anjmao / gist:078e50e045d13f1e72e57a7564d2d44b
Created March 12, 2018 09:01 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream