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 javax.validation.Constraint; | |
import javax.validation.Payload; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.Target; | |
import static java.lang.annotation.ElementType.FIELD; | |
import static java.lang.annotation.ElementType.PARAMETER; | |
import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
/** |
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 javax.validation.Constraint; | |
import javax.validation.Payload; | |
import java.lang.annotation.Documented; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.Target; | |
import static java.lang.annotation.ElementType.FIELD; | |
import static java.lang.annotation.ElementType.PARAMETER; | |
import static java.lang.annotation.RetentionPolicy.RUNTIME; |
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.mycompany.error; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import lombok.Data; | |
@Data | |
public class Error { | |
@JsonProperty(value = "errorMessage") | |
private String errorMessage; |
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
INSERT INTO <TABLE> | |
(<COLUMN 1>, <COLUMN 2>) | |
VALUES( <VALUE 1>,<VALUE 2>) | |
ON DUPLICATE KEY UPDATE | |
`<COLUMN1>` = '<VALUE1>'; |
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
<!DOCTYPE html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-csv/0.71/jquery.csv-0.71.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
// The event listener for the file upload | |
document.getElementById('txtFileUpload').addEventListener('change', upload, false); |
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 javax.net.ssl.HttpsURLConnection; | |
import javax.net.ssl.SSLContext; | |
import javax.net.ssl.TrustManager; | |
import javax.net.ssl.X509TrustManager; | |
import java.security.SecureRandom; | |
import java.security.cert.X509Certificate; | |
public class ConnectionUtil { | |
public static void trustConnection(){ |
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
$ df | |
This will list all mounted devices | |
$ sudo umount /dev/sdc<?> | |
where <?> is a number, look it up. Then, next: | |
$ sudo dd bs=4M if=input.iso of=/dev/sdc<?> | |
where input.iso is the input file, and /dev/sdc<?> is the USB device you're writing to. |
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 {Component, OnDestroy, OnInit} from '@angular/core'; | |
import {fromEvent, Observable, Subscription} from 'rxjs'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent implements OnInit, OnDestroy { | |
onlineEvent: Observable<Event>; |
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
<ifModule mod_headers.c> | |
Header always set Content-Security-Policy "upgrade-insecure-requests;" | |
</IfModule> |
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
def getPrevAndNext[A](lst: List[A], el: A): Option[(Option[A], A, Option[A])] = { | |
lst match { | |
case Nil => None | |
case x :: Nil if x == el => Some(None, x, None) | |
case _ :: Nil => None | |
case x :: y :: Nil if x == el => Some(None, x, Some(y)) | |
case x :: y :: Nil if y == el => Some(Some(x), y, None) | |
case x :: y :: z :: zs if x == el => Some(None, x, Some(y)) | |
case x :: y :: z :: zs if y == el => Some(Some(x), y, Some(z)) | |
case _ => getPrevAndNext(lst.tail, el) |
OlderNewer