Skip to content

Instantly share code, notes, and snippets.

View premrajah's full-sized avatar

Prem R premrajah

  • Random Circles
  • London
View GitHub Profile
@premrajah
premrajah / SQL Empty Data Set
Last active May 11, 2020 22:19
Simple SQL Hack - Use SQL to get a empty data Set to view all the column names
SELECT * FROM table_name
WHERE 1 = 2;
function Button(props) {
const handleClick = () => props.onClickFunction(props.increment);
return (
<button
onClick={handleClick} >
+{props.increment}
</button>);
}
#The strongly-typed approach(es)
The approach that we chose to retrieve the appsettings.json configuration values
makes use of the generic IConfiguration object, which can be queried using the
preceding string-based syntax. This approach is rather practical; however, if we want
to retrieve this data in a more robust way, for example, in a strongly typed fashion, we
can—and should—implement something better. Although we won't cover that in
more depth in this book, we suggest you read the following great articles, showing
three different approaches to achieving this result:
function ValidAnagram(first, second) {
if(first.length !== second.length){
return false;
}
const lookup = {};
for(let i = 0; i < first.length; i++){
let letter = first[i];
// if letter exists, increment or set to 1
@premrajah
premrajah / Bootstrap4_Button_Generator
Last active August 2, 2019 21:11
Bootstrap 4 CSS Button Generator
npm install bootstrap
Use sass compiler to compile to css
@import './node_modules/bootstrap/scss/bootstrap.scss';
$mynewcolor:rgb(7, 173, 136);
.btn-primary {
@include button-variant($mynewcolor, darken($mynewcolor, 7.5%), darken($mynewcolor, 10%), lighten($mynewcolor,5%), lighten($mynewcolor, 10%), darken($mynewcolor,30%));
}