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 upsert = async <Entity>(entity: ObjectType<Entity>, data: Entity, m: EntityManager, rawPKName: string = 'id'): Promise<InsertResult> => { | |
const keys: string[] = Object.keys(data) | |
if(keys.length < 1) { | |
throw Error(`Cannot upsert empty ${entity?.name || entity.constructor.name}`) | |
} | |
const updateStr: string = keys.map(key => `"${key}" = EXCLUDED."${key}"`).join(',') | |
return m.getRepository(entity) | |
.createQueryBuilder() |
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
FROM rabbitmq:3.8-management | |
ADD https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases/download/v3.8.0/rabbitmq_delayed_message_exchange-3.8.0.ez $RABBITMQ_HOME/plugins/rabbitmq_delayed_message_exchange-3.8.0.ez | |
RUN chown rabbitmq:rabbitmq $RABBITMQ_HOME/plugins/rabbitmq_delayed_message_exchange-3.8.0.ez \ | |
&& rabbitmq-plugins enable --offline rabbitmq_delayed_message_exchange \ | |
&& rabbitmq-plugins enable --offline rabbitmq_consistent_hash_exchange |
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
Contrary to popular belief Chuck Norris, not the Florida Supreme Court, made the final judgement on Terri Schiavo's fate. It was a roundhouse kick to the feeding tube. | |
A mighty crack was heard around the world as Chuck Norris roundhouse kicked the super-continent, Pangaea, beginning continental drift. | |
Chuck Norris doesn't understand why you should consult your doctor if your erection lasts for more than 4 hours. His erections have been known to last for up to 15 days. | |
Chuck Norris doesn't look at the toilet paper after he wipes. | |
Chuck Norris throws midgets for fun. He used to do it competitively, but it all ended horribly when he killed the pope. | |
Someone once tried to assassinate Chuck Norris's beard but missed hitting Chuck in the face, Chuck proceeded to beat the holy hell out of the guy using nothing but his penis and elbow, Chuck has since installed security on his beard, with a deflector diverting bullets to his face, since he values his beard more than even his rugged good looks. | |
Chuck Norris can kill a |
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
# ---------------------------------------------------------------------------- | |
# "THE BEER-WARE LICENSE" (Revision 42): | |
# <[email protected]> wrote this file. As long as you retain this notice you | |
# can do whatever you want with this stuff. If we meet some day, and you think | |
# this stuff is worth it, you can buy me a beer in return Antoine POUS | |
# ---------------------------------------------------------------------------- | |
# Copy this content to your ~/.bashrc then run `source ~/.bashrc` | |
# Usage: nvu <version> [options] | |
# Example: nvu 6 |
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
$.fn.serializeJSON = function () { | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function () { | |
if (o[this.name]) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); | |
} else { |
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
if(!String.prototype.startWith) { | |
String.prototype.startWith = function(needle) { | |
return this.substr(0, needle.length) === needle; | |
} | |
} | |
// Usage | |
'Hello world!'.startWith('hello'); // false | |
'Hello world!'.startWith('Hello'); // true |
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
/** | |
* "THE BEER-WARE LICENSE" (Revision 42): | |
* <[email protected]> wrote this file. As long as you retain this notice you | |
* can do whatever you want with this stuff. If we meet some day, and you think | |
* this stuff is worth it, you can buy me a beer in return Antoine "Gecko" Pous | |
*/ | |
// See https://gist.github.com/Antoine-Pous/d0a597ca756b5411ebd2 | |
var cookieChecker = function(){return"undefined"!=typeof navigator.cookieEnabled?(document.cookie="ac=test",e=-1!=document.cookie.indexOf("ac")?!0:!1,document.cookie="ac=; expires=Thu, 01 Jan 1970 00:00:00 UTC",e):navigator.cookieEnabled}, | |
// See https://gist.github.com/Antoine-Pous/c73e5a3a3b1e9507597d |
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
/** | |
* "THE BEER-WARE LICENSE" (Revision 42): | |
* <[email protected]> wrote this file. As long as you retain this notice you | |
* can do whatever you want with this stuff. If we meet some day, and you think | |
* this stuff is worth it, you can buy me a beer in return Antoine "Gecko" Pous | |
*/ | |
LSChecker = function() { | |
try { | |
localStorage.setItem('test', 'test'); |
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 | |
# ---------------------------------------------------------------------------- | |
# "THE BEER-WARE LICENSE" (Revision 42): | |
# <[email protected]> wrote this file. As long as you retain this notice you | |
# can do whatever you want with this stuff. If we meet some day, and you think | |
# this stuff is worth it, you can buy me a beer in return Antoine "Gecko" Pous | |
# ---------------------------------------------------------------------------- | |
USER=<sql_username> | |
PASSWORD=<sql_password> |