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
knex(TABLE_NAME) | |
.insert({ data : data }) | |
.onConflict(PRIMARY_KEY) | |
.merge() | |
.then((res) => { | |
... | |
}) | |
.catch((err) => { | |
... | |
}); |
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
<template> | |
<div id="app"> | |
<input v-on:focus="$event.target.select()" ref="myelement" readonly v-model="mytext" /> | |
<button v-on:click="copyElement">Copy</button> | |
</div> | |
</template> | |
<script> | |
export default { | |
data() { |
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
<input type="file" @change="previewFiles" ref="imagefile"> | |
methods: { | |
previewFiles(event) { | |
const fileToUpload = this.$refs.imagefile.files[0]; | |
const formData = new FormData(); | |
formData.append('fileToUpload', fileToUpload); | |
this.$http.post(`url/to/upload/script`, formData) | |
.then((res) => { | |
... |
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 | |
BUCKETS=$(aws s3 ls) | |
while IFS= read -r line | |
do | |
BUCKET=$(echo $line | cut -d " " -f3) | |
SIZE=$(aws s3 ls --summarize --human-readable --request-payer --recursive s3://$BUCKET/ | grep "Total Size" | cut -d ":" -f2) | |
echo "$BUCKET $SIZE" | |
done <<< "$BUCKETS" |
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
SELECT CONCAT( | |
'ALTER TABLE ', fks.quotedSourceTableName, ' ', | |
'ADD CONSTRAINT ', fks.quotedConstraintName, ' ', | |
'FOREIGN KEY (', GROUP_CONCAT(fks.quotedSourceColumnName), ') ', | |
'REFERENCES ', fks.quotedTargetTableName, ' (', | |
GROUP_CONCAT(fks.quotedTargetColumnName), | |
') ', | |
'ON DELETE ', fks.deleteRule, ' ', | |
'ON UPDATE ', fks.updateRule, ';' | |
) |
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
SELECT Concat('ALTER TABLE ', table_name, ' ', 'ADD ', | |
IF(non_unique = 1, CASE Upper(index_type) | |
WHEN 'FULLTEXT' THEN 'FULLTEXT INDEX' | |
WHEN 'SPATIAL' THEN 'SPATIAL INDEX' | |
ELSE Concat('INDEX ', index_name, ' USING ', | |
index_type) | |
end, IF(Upper(index_name) = 'PRIMARY', Concat( | |
'PRIMARY KEY USING ', index_type), | |
Concat('UNIQUE INDEX ', | |
index_name, ' USING ', |
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
backdrop-filter: blur(10px); |
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: grid; | |
place-items: center; |
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
cat -n <filename> |
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
http://source.unsplash.com/random/1200x600 |
NewerOlder