Skip to content

Instantly share code, notes, and snippets.

View edp1096's full-sized avatar

Robert Sung-wook Shin edp1096

View GitHub Profile
@ctmakro
ctmakro / klipper_on_win7.md
Last active June 20, 2024 11:34
20210526 How to compile and run Klipper (highest performance 3D printer firmware with most awesome features) on Anycubic Kossel (Arduino Mega / atmega2560) + OctoPrint from Windows 7 x64

How to compile and run Klipper on atmega2560 + OctoPrint from Windows 7 x64

Situation

  • I own an Anycubic Kossel delta 3D printer, running custom Marlin firmware, custom mainboard(atmega2560), connected to my PC via USB (USB Serial), controlled mostly via Printrun(Pronterface)
  • I want ultra high performance and latest improvements in my 3D printer, with the help from Klipper software/firmware
  • Normally you should go get an Raspberry Pi and do everything (compile/install Klipper / OctoPrint) from there, but I don't have a Pi, don't want to mess with the cables, decided to run Klipper from my PC

Steps

@charsyam
charsyam / timebased_otpcode_generator.go
Created January 13, 2021 13:54
Go Timebased OTP Code Generator
package main
import (
"crypto/rand"
"crypto/hmac"
"crypto/sha1"
"encoding/base32"
"time"
"fmt"
)
@komietty
komietty / canvas.vue
Created November 11, 2017 09:16
pixi in vue
<template lang="html">
<div :class="'img-'+this.mainImgID" id="cvs_thumnails_box">
<canvas id="cvs">
</canvas>
<div id="thumbnails">
<div v-for="t in thumbnails" @click="changeImg(t.id)" :class="'thumbnail-'+ t.id" class="thumbnail">
</div>
</div>
</div>
</template>
@rushilgupta
rushilgupta / GoConcurrency.md
Last active May 14, 2024 06:30
Concurrency in golang and a mini Load-balancer

INTRO

Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".

Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).

Let's dig in:

Goroutines

@tzmartin
tzmartin / embedded-file-viewer.md
Last active June 28, 2024 14:24
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@zg
zg / freebsd-qemu-xhyve-mac-os-x-virtual-machine.md
Last active June 24, 2024 02:16
Create FreeBSD virtual machine using qemu. Run the VM using xhyve.

TL;DR

  • Create 10GB FreeBSD image using QEMU.
  • Run the VM using xhyve.
  • Mount host directory.
  • Resize the image.

Requisites

@fiorix
fiorix / groupcache.go
Last active February 6, 2024 10:39
Simple groupcache example
// Simple groupcache example: https://github.com/golang/groupcache
// Running 3 instances:
// go run groupcache.go -addr=:8080 -pool=http://127.0.0.1:8080,http://127.0.0.1:8081,http://127.0.0.1:8082
// go run groupcache.go -addr=:8081 -pool=http://127.0.0.1:8081,http://127.0.0.1:8080,http://127.0.0.1:8082
// go run groupcache.go -addr=:8082 -pool=http://127.0.0.1:8082,http://127.0.0.1:8080,http://127.0.0.1:8081
// Testing:
// curl localhost:8080/color?name=red
package main
import (
@gbaman
gbaman / HowToOTG.md
Last active June 24, 2024 16:18
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@nkt
nkt / Results.md
Last active September 27, 2023 08:24
ReactPHP vs Node.js

wrk -t4 -c400 -d10s http://127.0.0.1:1337/

PHP

Running 10s test @ http://127.0.0.1:1337/
  4 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
 Latency 7.02ms 6.94ms 82.86ms 85.27%
@jpoehls
jpoehls / Caddyfile
Created May 7, 2015 23:29
Caddyfile PHP on Windows
# http://caddyserver.com/download
http://localhost:8080 {
startup php.cmd &
fastcgi / 127.0.0.1:9123 php
}