Skip to content

Instantly share code, notes, and snippets.

Daniel Hinojosa dhinojosa

Block or report user

Report or block dhinojosa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 5_Dashboard.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Demo - More! Pandas.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View BarChart.py
raw = merged.sort_values('Count', ascending=False)[:10]
xticks = np.arange(10)
fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, sharex=False, sharey=False)
ax1.bar(xticks, raw['Count'])
ax1.set_title('Complaints by States\n(raw)')
ax1.set_xticks(xticks)
ax1.set_xticklabels(raw['State'])
ax2.bar(xticks, normalized['population_normalized'])
View ML - Naive Bayes.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dhinojosa
dhinojosa / CapFirst.elm
Created May 14, 2019
Capitalize the first letter, all API calls model the possibility of things going wrong, but not with exceptions but with explicit types
View CapFirst.elm
-- From https://github.com/dhinojosa/elm-study/blob/master/src/PigLatin.elm
capFirst : String -> String
capFirst s =
case uncons s of
Just ( h, t ) ->
cons (Char.toUpper h) t
Nothing ->
""
View countries.json
{
"AD": {
"currency": {
"primary": "EUR"
},
"iso": {
"code2": "AD",
"code3": "AND",
"num": "020"
},
View settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>/usr/share/maven/ref/</localRepository>
<interactiveMode>true</interactiveMode>
<offline>false</offline>
</settings>
View NaiveBayes.py
# coding: utf-8
# In[2]:
from sklearn import datasets
from sklearn import metrics
from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import train_test_split
import numpy as np
@dhinojosa
dhinojosa / languages.json
Created Nov 17, 2018
A small list of programming languages, used as a web service for demos and trainings
View languages.json
[{
"name": "C",
"founders": ["Brian Kernighan", "Dennis Ritchie"]
},
{
"name": "C++",
"founders": ["Bjarne Strousoup"]
},
{
"name": "Java",
View EmployeeSpec.scala
package com.xyzcorp
import org.scalatest.{FunSpec, Matchers}
class EmployeeSpec extends FunSpec with Matchers {
describe("An employee") {
describe("when a first name and last name is given and full name is called") {
it("should return the first name and last name in between") {
val e = new Employee("Nikifor", "N")
e.fullName should be ("Nikifor N")
You can’t perform that action at this time.