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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'"> | |
<link href="./styles.css" rel="stylesheet"> | |
<title>Hello World!</title> | |
</head> | |
<body> |
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
// 14 March 2019 | |
// Updated Number().toFixed() polyfill to add-then-remove the trailing '1' in every case. | |
// see original at https://gist.github.com/dfkaye/e977af36e668aa134c0ce55bab5bb15f | |
// and at https://dfkaye.wordpress.com/2017/12/06/number-tofixed-rounding-errors-broken-but-fixable/ | |
/* | |
// fixes blog post solution | |
;(1.005).toFixed(2) == "1.01" || (function(prototype) { | |
var toFixed = prototype.toFixed |
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
/* | |
Copy from: http://web.archive.org/web/20090617110918/http://www.openasthra.com/c-tidbits/printing-binary-trees-in-ascii/ | |
Source: http://web.archive.org/web/20071224095835/http://www.openasthra.com:80/wp-content/uploads/2007/12/binary_trees1.c | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
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
git fetch --all | |
git reset --hard origin/master | |
git pull origin master |
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
int n = 1024 // entrada | |
String binario = '' // numero binario como string para poder verlo | |
int c = n | |
while (c > 1) | |
{ | |
// modulo (%) da 0 cuando el numero es par y da 1 cuando el numero impar | |
// los numeros pares en binario terminan en cero, y los impoares en 1, | |
// entonces esto sirve para tomar el ultimo bit y saber si es 0 o 1. | |
binario = (c % 2).toString() + binario |
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
// Place your key bindings in this file to override the defaultsauto[] | |
[ | |
{ | |
"key": "ctrl+alt+r", | |
"command": "workbench.files.action.showActiveFileInExplorer" | |
}, | |
{ | |
"key": "ctrl+alt+tab", | |
"command": "type", | |
"args": { |
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 | |
TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME | |
FROM | |
INFORMATION_SCHEMA.KEY_COLUMN_USAGE | |
WHERE | |
REFERENCED_TABLE_SCHEMA = (SELECT DATABASE()) AND | |
REFERENCED_TABLE_NAME = '$TABLE_NAME' |
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
// Consume timestamp in Java/Groovy | |
def timestamp = ... | |
def date = new Date(timestamp) | |
println new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date) | |
// Generate milliseconds in Groovy for current date | |
def timestamp = new Date().getTime() |
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
def lines = (1..10000000) | |
println lines.getClass() | |
// with list.each {} | |
def start = System.nanoTime() | |
lines.each { line-> | |
line++; | |
} |
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
// | |
// Write the mock request payload to a file for checking later... | |
// newWrite() is the important it to ensure you get a *new* file each time. | |
// | |
def filename = "C:\\MyScratchFolder\\soapUI projects\\Testing\\procon\\mock_po_activity_request.xml" | |
def file = new File(filename) | |
def w = file.newWriter() | |
w << mockRequest.requestContent | |
w.close() |
NewerOlder