Skip to content

Instantly share code, notes, and snippets.

@JoyeshShrestha
JoyeshShrestha / PY0101EN-3-4-Classes.ipynb
Created Jun 5, 2021
Created on Skills Network Labs
View PY0101EN-3-4-Classes.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View featureunion_columntransformer_text_data_part2.py
# Define sample customer transformers
class CharacterCounter(BaseEstimator, TransformerMixin):
"""Count the number of characters in a document."""
def __init__(self):
pass
def fit(self, X, y=None):
return self
def transform(self, X):
@cuongld2
cuongld2 / variant_id.go
Created Jun 5, 2021
Retrieve variant_id from complex json
View variant_id.go
var mapResp map[string]interface{}
if err := json.NewDecoder(res.Body).Decode(&mapResp); err == nil {
// fmt.Println(`&mapResp:`, &mapResp, "\n")
// fmt.Println(`mapResp["hits"]:`, mapResp["hits"])
for _, value := range mapResp["hits"].(map[string]interface{}) {
if reflect.TypeOf(value).Kind() != reflect.Float64 {
for _, each := range value.([]interface{}) {
@julian-st
julian-st / get_validator_duties.py
Created Jun 5, 2021
prysm v1.3.10 eth2 validator pos beacon
View get_validator_duties.py
"""
Originally developed by https://github.com/pietjepuk2
Ported to Prysm by https://twitter.com/mohamedmansour
Fix for version v1.3.10 by https://github.com/julian-st
Support my gitcoin https://gitcoin.co/julian-st
"""
import json
import math
import time
import urllib
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created Jun 5, 2021
Rimworld output log published using HugsLib
View output_log.txt
Log uploaded on Saturday, June 5, 2021, 4:35:16 PM
Loaded mods:
Harmony(brrainz.harmony)[mv:1.0.4.0]: 0Harmony(2.0.2), HarmonyMod(1.0.4)
BetterLoading(me.samboycoding.betterloading)[mv:3.1.2.0]: BetterLoading(2.3.0)
Core(Ludeon.RimWorld): (no assemblies)
Combat Extended(CETeam.CombatExtended)[mv:1.2.3.2]: 0Harmony(av:2.0.2,fv:2.0.4), CombatExtended(0.0.0)
Smart Speed(sarg.smartspeed): SmartSpeed(1.0.0)
Table Diner(antaioz.tdiner)[mv:1.35]: 0Harmony(av:2.0.2,fv:1.0.9.1), Table Diner Configurable(av:1.35.0,fv:1.35.0)
RimHUD(Jaxe.RimHUD): RimHUD(1.7.0)
Realistic Rooms Lite(crlsniper.realisticroomslite): (no assemblies)
View featureunion_columntransformer_text_data_part1.py
import numpy as np
import pandas as pd
pd.options.display.max_colwidth = 60
from nltk.tokenize import RegexpTokenizer
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import MinMaxScaler
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.compose import ColumnTransformer
@compcon
compcon / pilot.txt
Created Jun 5, 2021
Purple Rabbit - London Carver (LL:4)
View pilot.txt
{"id":"b465a465-3f43-4f48-82aa-b0e700f3cc8e","group":"","sort_index":0,"isLocal":true,"cloudID":"","cloudOwnerID":"","gistCode":"87a117e496840083a103236b595bd7a1","gistOwner":"f1f5cc7f-86bd-43fe-ae82-adb1ceef5516","lastSync":"2021-06-05T07:34:35.813Z","level":4,"callsign":"Purple Rabbit","name":"London Carver","player_name":"","status":"Active","dead":false,"text_appearance":"","notes":"","history":"","portrait":"","cloud_portrait":"","quirks":[],"current_hp":8,"reserves":[{"id":"reserve_core_battery","type":"Mech","name":"CORE battery","label":"Battery","description":"An extra battery that allows a second use of a mech’s CORE SYSTEM.","resource_name":"","resource_note":"","resource_cost":"","used":false}],"orgs":[],"background":"CELEBRITY","mechSkills":[0,2,4,0],"licenses":[{"id":"mf_dusk_wing","rank":3},{"id":"mf_goblin","rank":1}],"skills":[{"id":"sk_act_unseen_or_unheard","rank":1},{"id":"sk_show_off","rank":2},{"id":"sk_hack_or_fix","rank":2},{"id":"sk_invent_or_create","rank":2},{"id":"sk_stay_cool","ra
@bhandariamit5
bhandariamit5 / PY0101EN-2-2-Lists.ipynb
Created Jun 5, 2021
Created on Skills Network Labs
View PY0101EN-2-2-Lists.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View openpanzer-save.json
{"scenario":{"name":"Syracuse","maxTurns":14,"date":"1943-07-09T22:00:00.000Z","atmosferic":0,"latitude":1,"ground":0,"turnsPerDay":16,"dayTurn":0,"reinforcements":{"3":[{"row":1,"col":21,"unit":{"eqid":228,"id":-1,"owner":1,"hasMoved":false,"hasFired":false,"hasResupplied":false,"hasOverstrength":false,"isMounted":false,"isSurprised":false,"isDeployed":false,"isCore":false,"tempSpotted":false,"strength":10,"facing":1,"flag":13,"destroyed":false,"transport":null,"carrier":0,"moveLeft":16,"ammo":9,"fuel":0,"hasAnimation":false,"hits":0,"experience":257,"entrenchment":0,"entrenchTicks":0,"leader":-1},"turn":"3","id":1}],"4":[{"row":31,"col":13,"unit":{"eqid":732,"id":-1,"owner":1,"hasMoved":false,"hasFired":false,"hasResupplied":false,"hasOverstrength":false,"isMounted":false,"isSurprised":false,"isDeployed":false,"isCore":false,"tempSpotted":false,"strength":10,"facing":4,"flag":13,"destroyed":false,"transport":{"eqid":224,"ammo":0,"fuel":55,"icon":"resources/units/images/pat86.png"},"carrier":0,"moveLeft":3,"