Skip to content

Instantly share code, notes, and snippets.

View FonzTech's full-sized avatar
😄
Developing

Alfonso FonzTech

😄
Developing
View GitHub Profile
@ahorn42
ahorn42 / Share-PartialScreen.ps1
Last active August 31, 2023 07:14
A small powershell script to allow to record and play back a part of your screen with VLC to allow partial screen sharing in communication tools like Teams.
function Share-PartialScreen {
[CmdletBinding(DefaultParameterSetName='Preset')]
Param(
[Parameter(Mandatory = $false)]
[string] $preset,
[Parameter(Mandatory = $false)]
[int] $Width = 1920,
[Parameter(Mandatory = $false)]
[int] $Height = 1080
)
@veetaw
veetaw / main.dart
Created June 24, 2019 15:00
How a clean lib/main.dart should look
import 'package:flutter/material.dart';
void main() {
runApp(Application());
}
class Application extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@MattHealy
MattHealy / apigateway-sqs-integration.yaml
Created May 22, 2019 02:53
Cloudformation Template for API Gateway AWS Service Integration to SQS Queue
Description: API Gateway to JSON payloads and send to SQS
Outputs:
ApiEndpoint:
Description: Endpoint for this stage of the api
Value: !Join
- ''
- - https://
- !Ref 'SQSProxy'
- .execute-api.ap-southeast-2.amazonaws.com/
- prod
@miguelmota
miguelmota / crypto.go
Last active June 5, 2024 14:28
Golang SHA256 hash example
package crypto
import (
"crypto/sha256"
)
// NewSHA256 ...
func NewSHA256(data []byte) []byte {
hash := sha256.Sum256(data)
return hash[:]
@yossan
yossan / string2cstring.swift
Last active May 20, 2022 12:47
Making UnsafeMutablePointer<Int8> from String
// Method 1
// String → UnsafePointer<Int8> → UnsafeMutablePointer<Int8>
// Note: func withCString<Result>(_ body: (UnsafePointer<Int8>) throws -> Result) rethrows -> Result
// Note: String.UTF8View doesn't include null character.
func makeCString(from str: String) -> UnsafeMutablePointer<Int8> {
let count = str.utf8.count + 1
let result = UnsafeMutablePointer<Int8>.allocate(capacity: count)
str.withCString { (baseAddress) in
// func initialize(from: UnsafePointer<Pointee>, count: Int)
@bgadrian
bgadrian / set.go
Last active June 4, 2024 16:29
How to implement a simple set data structure in golang
type Set struct {
list map[int]struct{} //empty structs occupy 0 memory
}
func (s *Set) Has(v int) bool {
_, ok := s.list[v]
return ok
}
@hamdifourati
hamdifourati / telepresence_centos7.sh
Last active January 7, 2021 22:28
Hack your way to install Telepresence on CentOS7
#!/bin/bash
set -ex
yum update -y
# install python3.6
yum -y install yum-utils
yum -y groupinstall development
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum -y install python36u
@trymbill
trymbill / gist:136dfd4bfc0736fae5b959430ec57373
Created October 20, 2017 10:16
The smallest base64 encoded JPG I could make (for testing purposes)
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/wAALCAABAAEBAREA/8QAFAABAAAAAAAAAAAAAAAAAAAACf/EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAD8AKp//2Q==
@matti
matti / add.sh
Created July 29, 2017 11:12
alpine docker add package from edge testing
apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
x11vnc
@dyerrington
dyerrington / overfitting_decision_trees.md
Created May 12, 2017 19:10
Re: Why are decision trees prone to overfitting, I’ll do my best --

Overfitting in decision trees

Overfitting can be one problem that describes if your model no longer generalizes well.

Overfitting happens when any learning processing overly optimizes training set error at the cost test error. While it’s possible for training and testing to perform equality well in cross validation, it could be as the result of the data being very close in characteristics, which may not be a huge problem. In the case of decision tree’s they can learn a training set to a point of high granularity that makes them easily overfit. Allowing a decision tree to split to a granular degree, is the behavior of this model that makes it prone to learning every point extremely well — to the point of perfect classification — ie: overfitting.

I recommend the following steps to avoid overfitting:

  • Use a test set that is not exactly like the training set, or different enough that error rates are going to be easy to see.