Skip to content

Instantly share code, notes, and snippets.

Avatar

Nissan Dookeran nissan

View GitHub Profile
@nissan
nissan / dataframe_dataset.py
Created Aug 27, 2018 — forked from lextoumbourou/dataframe_dataset.py
Torchtext dataset from DataFrame
View dataframe_dataset.py
from torchtext import data
class DataFrameDataset(data.Dataset):
def __init__(self, df, text_field, label_field, is_test=False, **kwargs):
fields = [('text', text_field), ('label', label_field)]
examples = []
for i, row in df.iterrows():
label = row.sentiment if not is_test else None
text = row.text
View setup-laptop.ps1
# Author: Nissan Dookeran
# Email: nissan.dookeran@gmail.com
# Date Last Updated: 20-Oct-2020.
# Run from elevated Powershell prompt (Run as Administrator)
#Install Windows subsystem for Linux, upgrade to V2
#reference https://docs.microsoft.com/en-us/windows/wsl/install-win10
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
#will need to restart here
@nissan
nissan / docker-compose-seq.yml
Last active Oct 12, 2020
Start SEQ containers in docker with GELF ingestion and Syslog ingestion
View docker-compose-seq.yml
version: '3'
services:
seq-input-syslog:
image: datalust/seq-input-syslog:latest
depends_on:
- seq
ports:
- "514:514/udp"
environment:
SEQ_ADDRESS: "http://seq:5341"
View windows-terminal-settings.json
// This file was initially generated by Windows Terminal Preview 1.1.1671.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
View Baseline.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nissan
nissan / Update-All-Git-Repos.ps1
Last active Feb 13, 2020
Go thru a directory with multiple repository directories, fetch their latest remotes, pull the latest for current branch, if currently on a divergent branch, pull latest master and rebase this branch to master
View Update-All-Git-Repos.ps1
# Author: Nissan Dookeran
# Email: nissan.dookeran@gmail.com
# Date: 14-02-2020
# Purpose: Go thru a directory with multiple repository directories,
# - fetch their latest remotes
# - if on master branch pull the latest
# - if currently on a divergent branch, pull latest and rebase this branch to origin/master
$cwd = Get-Location
$fg = "DarkGreen"
$bg = "White"
@nissan
nissan / Styles.js
Last active Feb 7, 2020
styled-component base definition from Final Form website
View Styles.js
import styled, { css } from 'styled-components'
const btn = (light, dark) => css`
white-space: nowrap;
display: inline-block;
border-radius: 5px;
padding: 5px 15px;
font-size: 16px;
color: white;
&:visited {
@nissan
nissan / new-dotnetcore-react-ts-storybook-jest.ps1
Created Jun 2, 2018
Setup a new .NET Core 2.1 app for Windows with React, TypeScript, Storybook, Jest
View new-dotnetcore-react-ts-storybook-jest.ps1
Assumes you have the .NET SDK 2.1 for Windows already installed
#Use Chocolatey to install packages, run this script from Administrator Powershell
Set-ExecutionPolicy Bypass -Scope Process -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
#Use nvm to manage node versions
choco install -y nvm
nvm use default
#install yarn independent of version of node being used
choco install -y yarn
refreshenv
@nissan
nissan / new-dotnetcore-react-storybook-jest-app.ps1
Created Jun 1, 2018
Setup a new .NET Core 2.1 app for Windows with React, Storybook, Jest
View new-dotnetcore-react-storybook-jest-app.ps1
#Assumes you have the .NET SDK 2.1 for Windows already installed
#Use Chocolatey to install packages, run this script from Administrator Powershell
Set-ExecutionPolicy Bypass -Scope Process -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
#Use nvm to manage node versions
choco install -y nvm
nvm use default
#install yarn independent of version of node being used
choco install -y yarn
refreshenv
View hummingbird_custom_2-resnet34.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.