This file contains 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
/* | |
Display Custom Characters on 16×2 LCD | |
For more details, visit: https://techzeero.com/arduino-tutorials/custom-characters-on-16x2-lcd/ | |
*/ | |
#include<LiquidCrystal.h> | |
LiquidCrystal lcd(12,11,5,4,3,2); | |
byte smile[8] = {0b00000,0b01010,0b00000,0b00000,0b10001,0b01110,0b00000,0b00000}; |
This file contains 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
export class Page<T> { | |
count: number; // total number of items | |
next: string; // URL of the next page | |
previous: string; // URL of the previous page | |
results: Array<T>; // items for the current page | |
} |
This file contains 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 com.domain; | |
import com.domain.Module; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.data.domain.Page; | |
import org.springframework.data.domain.PageImpl; | |
import org.springframework.data.domain.Pageable; | |
import org.springframework.jdbc.core.JdbcTemplate; | |
import org.springframework.stereotype.Repository; |
This file contains 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
mapToHttpParams(params) | |
function mapToHttpParams (m : Map) : String { | |
let s = ""; | |
if (!empty(m)) { | |
for(let key in m) { | |
let value = m[key]; | |
if (!empty(value)) { | |
s = StringUtils.format("{0}{1}{2}={3}", | |
s, | |
(s.length != 0) ? "&":"", |
This file contains 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 quillModules = { | |
toolbar: ["bold", "italic", "underline", "strike"], | |
// mentions is added in constructor | |
keyboard: { | |
bindings: { | |
tab: { | |
key: 9, | |
handler: function(range, context) { | |
return this.quill.mentionHandler(range.context); | |
} |
This file contains 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
#!/bin/bash | |
# save this file as tailc then | |
# run as: $ tailc logs/supplier-matching-worker.log Words_to_highlight | |
file=$1 | |
if [[ -n "$2" ]]; then | |
color=' | |
// {print "\033[37m" $0 "\033[39m"} | |
/(WARN|WARNING)/ {print "\033[1;33m" $0 "\033[0m"} | |
/(ERROR|CRIT)/ {print "\033[1;31m" $0 "\033[0m"} |
This file contains 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
var accounts = [ | |
{ name: 'James Brown', msgCount: 123 }, | |
{ name: 'Stevie Wonder', msgCount: 22 }, | |
{ name: 'Sly Stone', msgCount: 16 }, | |
{ name: 'Otis Redding', msgCount: 300 } // Otis has the most messages | |
]; | |
// get sum of msgCount prop across all objects in array | |
var msgTotal = accounts.reduce(function(prev, cur) { | |
return prev + cur.msgCount; |
This file contains 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
/** | |
* Uses Tikas {@link AutoDetectParser} to extract the text of a file. | |
* | |
* @param document | |
* @return The text content of a file | |
*/ | |
@Override | |
public String extractTextOfDocument(File file) throws Exception { | |
InputStream fileStream = new FileInputStream(file); | |
Parser parser = new AutoDetectParser(); |
This file contains 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
import java.util.Hashtable; | |
import java.io.Console; | |
import javax.naming.Context; | |
import javax.naming.directory.DirContext; | |
import javax.naming.directory.InitialDirContext; | |
public class TestAuth { | |
public static void main(String[] args) { |
This file contains 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
/* | |
* Copyright 2014-2015 Marius Volkhart | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
NewerOlder