Skip to content

Instantly share code, notes, and snippets.

View jamesxv7's full-sized avatar
🔬
Researching

Jaime Olmo jamesxv7

🔬
Researching
View GitHub Profile
@jamesxv7
jamesxv7 / DeleteBlankRows.vba
Created February 28, 2018 21:12
Delete blank rows in Excel using VBA
Sub DeleteBlankRows()
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "Title"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
xRows = WorkRng.Rows.Count
Application.ScreenUpdating = False
For i = xRows To 1 Step -1

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@jamesxv7
jamesxv7 / read-json.js
Created August 24, 2017 20:03
Nested reading of a json structure using Node.js
const fs = require('fs');
var total = 0
fs.readFile('lists.json', 'utf8', function (err, data) {
if (err) throw err;
obj = JSON.parse(data);
for (var user in obj) {
console.log('Lists from', user)
for (var list in obj[user]) {
// Place your settings in this file to overwrite the default settings
{
// Controls the font family.
"editor.fontFamily": "hack",
// Controls the font size.
"editor.fontSize": 14,
// Controls whether the editor should render whitespace characters
"editor.renderWhitespace": "all",
// Controls the rendering size of tabs in characters. Accepted values: "auto", 2, 4, 6, etc. If set to "auto", the value will be guessed when a file is opened.
"editor.tabSize": 2,
@echo ========= SQL Server Ports ===================
@echo Enabling SQLServer default instance port 1433
netsh firewall set portopening TCP 1433 "SQLServer"
@echo Enabling Dedicated Admin Connection port 1434
netsh firewall set portopening TCP 1434 "SQL Admin Connection"
@echo Enabling conventional SQL Server Service Broker port 4022
netsh firewall set portopening TCP 4022 "SQL Service Broker"
@echo Enabling Transact-SQL Debugger/RPC port 135
netsh firewall set portopening TCP 135 "SQL Debugger/RPC"
@echo ========= Analysis Services Ports ==============
@jamesxv7
jamesxv7 / gist:26184b41e07c57816f2185ced14e11f8
Created May 7, 2017 16:45
Nice use of variables in a for loop.js
function someFunc(array) {
// some code...
// some code...
const length = array.length;
for (let index = 0; index < length; index++) {
const item = array[index];
// some
}
return 'some result';
}
// Kevin Pilard @kpilard Apr 11 16:17
// @jamesxv7
import { Validator } from 'vee-validate';
var app = new Vue({
el: '#app',
created () {
this.validator = new Validator(this.validationRules)
},
const http = require('http')
const port = 3000
const requestHandler = (request, response) => {
console.log(request.url)
response.end('Hello Node.js Server!')
}
const server = http.createServer(requestHandler)
// Simple function definition
function function01() {
console.log('This is function #1')
}
// Function expression
const fnExpression = () => {
console.log('This is an function epression example')
}
//Kata: https://www.codewars.com/kata/vasya-clerk/train/javascript
function tickets(peopleInLine){
var ticketPrice = 25
var bills = [0, 0, 0]
// Just count the bills... forget the register value
for (var i = 0; i < peopleInLine.length; i++) {
if (peopleInLine[i] == ticketPrice) {
bills[0] += 1 // Clients with $25 are the easy ones