Skip to content

Instantly share code, notes, and snippets.

View ghalter's full-sized avatar

Gaudenz Halter ghalter

View GitHub Profile

Setup

  • Create a developer account with Apple
  • Download and install X-Code from the Apple App Store
  • Open and run X-Code app and install whatever extras it requires
  • Open the preferences pane (cmd+,)
    • click the + in the lower right corner
    • choose Apple ID
    • enter your apple ID and password
import React, {createRef, Component} from 'react';
import {render} from 'react-dom';
import {StaticMap} from 'react-map-gl';
import DeckGL, {TileLayer, BitmapLayer} from 'deck.gl';
import {interpolateViridis, interpolateInferno} from 'd3-scale-chromatic'
import Pbf from 'pbf'
const MAPBOX_TOKEN = '...'
let INITIAL_VIEW_STATE = {
latitude: -25.734968,
@wassname
wassname / keras_weighted_categorical_crossentropy.py
Last active December 19, 2023 18:17
Keras weighted categorical_crossentropy (please read comments for updated version)
"""
A weighted version of categorical_crossentropy for keras (2.0.6). This lets you apply a weight to unbalanced classes.
@url: https://gist.github.com/wassname/ce364fddfc8a025bfab4348cf5de852d
@author: wassname
"""
from keras import backend as K
def weighted_categorical_crossentropy(weights):
"""
A weighted version of keras.objectives.categorical_crossentropy
@opnchaudhary
opnchaudhary / ftp_uploader.py
Created March 15, 2014 03:11
A sample example for uploading files using ftp in python
#!/usr/bin/python
import ftplib
session = ftplib.FTP('example.com','username','password')
file = open('cup.mp4','rb') # file to send
session.storbinary('STOR '+'cup.mp4', file) # send the file
file.close() # close file and FTP
session.quit()