The following code will read in a YAML file and store it in a dictionary. The dictionary content is then printed to the console.
config.yaml
test: value
nested:
test: nestedValue
The following code will read in a YAML file and store it in a dictionary. The dictionary content is then printed to the console.
config.yaml
test: value
nested:
test: nestedValue
If you have multiple SSH keys generated for different purposes (one for GitHub, one for server administration, etc...) you can specify which private key to use via config.
In ~/.ssh/config
you may have the following:
host github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa.github
User <your PC user name (not GitHub user name)>
Here are two examples of how to define a composite primary key for some table using Liquibase.
<changeSet id="1">
<createTable tableName="some_table">
<column name="id_1" type="varchar_ignorecase">
<constraints nullable="false" primaryKey="true" primaryKeyName="PK_SOME_TABLE"></constraints>
Many examples on the internet just say to call http.csrf().disable()
, but this ends up disabling all authentication (causes the AuthenticationPrincipal
to always be null
).
Here is how to disable CSRF protection for a REST service when using Spring Boot without disabling all authentication.
@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
# Download H2 driver
mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -Dartifact=com.h2database:h2:1.4.200
Full documentation: https://maven.apache.org/plugins/maven-dependency-plugin/get-mojo.html
I needed to password protect an existing H2 database. I wanted to do two things:
DROP USER ""
;
CREATE USER IF NOT EXISTS example PASSWORD 'example password' ADMIN;
/* tslint:disable */ | |
import { AutocompleteCandidate } from '../autocomplete/candidate'; | |
// Source code token from below link | |
// https://gist.github.com/tpae/72e1c54471e88b689f85ad2b3940a8f0 | |
// @MODIFIED has been added where modifications have been made | |
// | |
// Trie.js - super simple JS implementation | |
// https://en.wikipedia.org/wiki/Trie |
// assume you have a member on the component like dataSource1: MatTableDataSource<any>; and dataSource2: MatTableDataSource<any>; that | |
// are the datasources for the two tables | |
@ViewChildren(MatSort) set matSort(matSortList: QueryList<MatSort>) { | |
const ref = this; | |
matSortList.forEach((matSort: any, index: number) => { | |
const dataSource = ref['dataSource' + (index + 1)]; | |
// https://material.angular.io/components/table/api | |
// to see about sortingDataAccessor | |
dataSource.sortingDataAccessor = (item: any, property: string) => { | |
if (cond1) { |
""" | |
Oracle database connection wrapper | |
@author: jbaranski | |
""" | |
import cx_Oracle | |
class OracleDB: | |
""" | |
Usage: |
# nexus 2.x | |
# Assuming you run this command against the directory the jar sits in | |
# | |
# r - repository | |
# hasPom - whether you are supplying the pom or you want one generated. If generated g, a, v, p, and c are not needed | |
# e - extension | |
# g - group id | |
# a - artifact id | |
# v - version | |
# p - packaging |