Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / setup.R
Created March 15, 2020 00:24
R install packages stagted
Sys.setenv(R_INSTALL_STAGED = FALSE)
@cicorias
cicorias / importit.py
Created March 8, 2020 02:01
import python class from string
import importlib
module = importlib.import_module('my_package.my_module')
my_class = getattr(module, 'MyClass')
my_instance = my_class()
@cicorias
cicorias / README.md
Created January 13, 2020 23:33 — forked from iki/README.md
Update global top level npm packages

Update global top level npm packages

Problem

npm update -g updates all global packages and their dependencies, see npm/npm#6247.

Solution

  1. Either use the shell script or windows batch here instead.

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@cicorias
cicorias / terraform.txt
Created December 10, 2019 14:31
HDInsight creation terraform wrong vm sku azure
error with tf hdinsight
azurerm_hdinsight_hadoop_cluster.hdpcluster: Still destroying... [id=/subscriptions/b00a4572-2115-4d17-a2e5-....HDInsight/clusters/scicoriahdicluster, 40s elapsed]
azurerm_hdinsight_hadoop_cluster.hdpcluster: Still destroying... [id=/subscriptions/b00a4572-2115-4d17-a2e5-....HDInsight/clusters/scicoriahdicluster, 50s elapsed]
azurerm_hdinsight_hadoop_cluster.hdpcluster: Still destroying... [id=/subscriptions/b00a4572-2115-4d17-a2e5-....HDInsight/clusters/scicoriahdicluster, 1m0s elapsed]
azurerm_hdinsight_hadoop_cluster.hdpcluster: Destruction complete after 1m2s
Destroy complete! Resources: 1 destroyed.
data.azurerm_resource_group.hdpcluster: Refreshing state...
@cicorias
cicorias / MergeSort.java
Created October 16, 2019 03:16 — forked from louisbros/MergeSort.java
Java Merge Sort
package com.test;
import java.util.ArrayList;
import java.util.List;
public class MergeSort<T extends Comparable<T>> {
public void sort(List<T> values){
mergeSort(0, values.size() - 1, values, new ArrayList<T>(values));
}
const { createServer } = require('http');
createServer((req, res) => {
res.writeHead(200, {
Connection: 'Transfer-Encoding',
'Content-Type': 'text/html; charset=utf-8',
'Transfer-Encoding': 'chunked'
});
res.write(`
@cicorias
cicorias / Movie_recomender.ipynb
Created September 30, 2019 19:32
movie recommendations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cicorias
cicorias / Windows Defender Exclusions for Developer.ps1
Created September 30, 2019 02:46 — forked from nerzhulart/Windows Defender Exclusions for Developer.ps1
Adds Windows Defender exclusions for developers (Visual Studio, JetBrains Rider, IntellIJ Idea, Git, MsBuild, dotnet, mono etc.)
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files (x86)\Microsoft Visual Studio 14.0') > $null
@cicorias
cicorias / zscore.py
Created September 17, 2019 11:44 — forked from mnguyenngo/zscore.py
Code to calculate and plot the z-score
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as scs
def z_val(sig_level=0.05, two_tailed=True):
"""Returns the z value for a given significance level"""
z_dist = scs.norm()
if two_tailed:
sig_level = sig_level/2
area = 1 - sig_level