Skip to content

Instantly share code, notes, and snippets.

View makubexD's full-sized avatar
🏠
Working from home

makubexD

🏠
Working from home
View GitHub Profile
@makubexD
makubexD / Instructions.md
Created October 18, 2021 22:39 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@makubexD
makubexD / pre-commit
Created July 16, 2021 00:46 — forked from posquit0/pre-commit
Git Pre Commit Hook for ESLint and Jest
#!/usr/bin/env bash
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.jsx\?$')
BIN_PATH="$(git rev-parse --show-toplevel)/node_modules/.bin"
eslint() {
ESLINT="$BIN_PATH/eslint"
# Check for eslint
@makubexD
makubexD / sendemailsasync.cs
Created October 9, 2019 19:45
Sending multiple emails in parallel using SmtpClient.SendMailAsync with async and Task.WhenAll
var sendEmailTasks = recipientList.Select(async recipient =>
{
var message = new MailMessage { To = { recipient }, ... };
// instantiate a new client for each mail because of this:
// http://www.codefrenzy.net/2012/01/30/how-asynchronous-is-smtpclient-sendasync/
using (var smtpClient = new SmtpClient())
{
await smtpClient.SendMailAsync(message);
}
@makubexD
makubexD / northwindDataInsert.sql
Created September 5, 2019 17:44
northwind for oracle data (Insert to tables)
INSERT INTO northwind.customers (id, company, last_name, first_name, email_address, job_title, business_phone, home_phone, mobile_phone, fax_number, address, city, state_province, zip_postal_code, country_region, web_page, notes, attachments)
SELECT 1, 'Company A' , 'Bedecs' , 'Anna' , NULL, 'Owner' , '(123)555-0100', NULL, NULL, '(123)555-0101', '123 1st Street' , 'Seattle' , 'WA', '99999', 'USA', NULL, NULL, '' FROM dual UNION ALL
SELECT 2, 'Company B' , 'Gratacos Solsona' , 'Antonio' , NULL, 'Owner' , '(123)555-0100', NULL, NULL, '(123)555-0101', '123 2nd Street' , 'Boston' , 'MA', '99999', 'USA', NULL, NULL, '' FROM dual UNION ALL
SELECT 3, 'Company C' , 'Axen' , 'Thomas' , NULL, 'Purchasing Representative', '(123)555-0100', NULL, NULL, '(123)555-0101', '123 3rd Street' , 'Los Angelas' , 'CA', '99999', 'USA', NULL, NULL, '' FROM dual UNION ALL
SELECT 4, 'Company D' , 'Lee' , 'Chris
@makubexD
makubexD / northwindSchema.sql
Created September 5, 2019 17:43
northwind schema for oracle with grants
CREATE USER northwind IDENTIFIED BY northwind;
ALTER SESSION SET CURRENT_SCHEMA = northwind;
ALTER USER northwind quota 100M on USERS;
--select * from northwind.customers
/* Table: customers */
CREATE TABLE northwind.customers (
@makubexD
makubexD / GeoLocation.js
Created April 30, 2018 20:54 — forked from ederoyd46/GeoLocation.js
Javascript for finding latitude and longitude range boundaries
//Javascript for finding latitude and longitude range boundaries.
//Based on the excellent Java example by http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates
var GeoLocation = GeoLocation ? GeoLocation : {
TO_RADIAN: 0.0174532925,
TO_DEGREE: 57.2957795,
EARTH_RADIUS: 6371.01,
TO_MILE: 0.621371192,
TO_KM: 1.609344,
MIN_LAT: function() { return GeoLocation.degreeToRadian(-90) },
@makubexD
makubexD / demo.java
Created April 5, 2018 20:17
demoTest
filDemoMauri