Skip to content

Instantly share code, notes, and snippets.

View gabrielizalo's full-sized avatar
🇨🇴

Gabriel Porras gabrielizalo

🇨🇴
View GitHub Profile
@gabrielizalo
gabrielizalo / AntiClickJacking.html
Created July 8, 2017 00:22
.Net - Anti ClickJacking
<style>
body{display:none;}
</style>
<script>
if(self==top){
document.getElementsByTagName("body")[0].style.display="block";
}else{
top.location=self.location;
}
</script>
@gabrielizalo
gabrielizalo / jQueryExists.js
Created July 8, 2017 00:21
jQuery - Exists
// if element exists
if($('selector').length){ //do something }
// if element does not exist
if(!$('selector').length){ //do something }
@gabrielizalo
gabrielizalo / Promises.js
Created July 8, 2017 00:19
Javascript - Promises
// Definition
// ----------------
var p = new Promise(function(resolve, reject) {
// Do an async task async task and then...
if(/* good condition */) {
resolve('Success!');
}
else {
@gabrielizalo
gabrielizalo / GetDateWithoutTime.sql
Created July 8, 2017 00:18
MS SQL - GetDate without time
SELECT CAST ( FLOOR ( CAST ( GETDATE() AS DECIMAL (12, 5) ) ) AS DATETIME )
@gabrielizalo
gabrielizalo / DateInternationalFormat.sql
Created July 8, 2017 00:16
MS SQL - Date in format YYYYMMDD as String
SELECT CONVERT ( VarChar(8), GETDATE(), 112)
@gabrielizalo
gabrielizalo / DateTime.cs
Created July 8, 2017 00:07
DateTimeVariable.ToString("yyyyMMdd")
DateTimeVariable.ToString("yyyyMMdd")
@gabrielizalo
gabrielizalo / header.sql
Last active September 6, 2018 14:26
MS SQL - Header for SQL programs (views, functions, sps...)
-- =============================================
-- Author: <Author Name>
-- Create date: <Creation date>
-- Description: <Description>
-- Example: <Example code to execute>
-- History: <Modification date> > <Description of the modification>
-- <Modification date> > <Description of the modification>
-- =============================================