Skip to content

Instantly share code, notes, and snippets.

View tbass134's full-sized avatar

Tony Hung tbass134

  • Upstate New York
View GitHub Profile
@aseemk
aseemk / README.md
Last active February 14, 2018 16:41
A bookmarklet for "selecting all" (technically, "toggling all") checkboxes on the Amazon AWS S3 console.
@santhoshtr
santhoshtr / Logger.js
Last active October 17, 2018 12:00
Winston based configurable node logger
var winston = require( 'winston' ),
fs = require( 'fs' ),
logDir = 'log', // Or read from a configuration
env = process.env.NODE_ENV || 'development',
logger;
winston.setLevels( winston.config.npm.levels );
winston.addColors( winston.config.npm.colors );
if ( !fs.existsSync( logDir ) ) {
@choongng
choongng / notes.md
Last active December 29, 2019 23:01
Swift for TensorFlow quick start with Docker on Mac

A good way to get a taste of Swift for Tensorflow language and tools is to set it up with Jupyter with the fastai Swift notebooks. I wanted a quick setup, which the Mac install experience currently not, so instead I installed the release binaries in a Ubuntu container via Docker. The setup process for this scenario is not well documented, so here it is for you / future me.

What we're about to do is install the S4TF 0.4 release and the fastai v3 Swift notebooks on Ubuntu 18.04. Generally we follow the swift-jupyter docker file, but install cpu-only release versions of the packages.

Below are some of the references I looked at:

Rationale for S4TF and background reading

https://github.com/tensorflow/swift/blob/master/docs/WhySwiftForTensorFlow.md https://github.com/tensorflow/swift/blob/master/docs/DifferentiableFunctions.md

function ConnectButton(){
console.log("Connect pushed");
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click()
}
setInterval(ConnectButton,60000);
@humbertodias
humbertodias / gist:3138cf7753b6814d37b606764fb9efaf
Created March 19, 2017 13:06
Exporting Mysql server to internet
# tunnel online
ngrok tcp 3306
# connection
user=root
pass=techne
host=0.tcp.ngrok.io
port=16799
mysql -u$user -h$host -P$port -p$pass
@gillesdemey
gillesdemey / querystring.swift
Last active March 24, 2021 10:53
Retrieve specific query string parameter from NSURL
func getQueryStringParameter(url: String, param: String) -> String? {
let url = NSURLComponents(string: url)!
return
(url.queryItems? as [NSURLQueryItem])
.filter({ (item) in item.name == param }).first?
.value()
}
@mayoff
mayoff / Arrow.swift
Last active May 13, 2022 07:30
UIBezierPath category to create an arrow (now with a Swift version!)
// Swift 2.2 syntax / API
import UIKit
extension UIBezierPath {
class func arrow(from start: CGPoint, to end: CGPoint, tailWidth: CGFloat, headWidth: CGFloat, headLength: CGFloat) -> Self {
let length = hypot(end.x - start.x, end.y - start.y)
let tailLength = length - headLength
@calebd
calebd / ArrayHelpers.swift
Last active November 4, 2022 15:17
Swift Helpers
extension Array {
func first() -> Element? {
if isEmpty {
return nil
}
return self[0]
}
func last() -> Element? {
@NatashaTheRobot
NatashaTheRobot / WatchConnectivitySingletonDemo.swift
Last active December 29, 2022 14:44
WatchConnectivity Singleton Demo
//
// WatchSessionManager.swift
// WatchConnectivityDemo
//
// Created by Natasha Murashev on 9/3/15.
// Copyright © 2015 NatashaTheRobot. All rights reserved.
//
import WatchConnectivity
@Alex-Just
Alex-Just / strip_emoji.py
Last active June 29, 2023 18:12
Python regex to strip emoji from a string
import re
# http://stackoverflow.com/a/13752628/6762004
RE_EMOJI = re.compile('[\U00010000-\U0010ffff]', flags=re.UNICODE)
def strip_emoji(text):
return RE_EMOJI.sub(r'', text)
print(strip_emoji('🙄🤔'))