Skip to content

Instantly share code, notes, and snippets.

View ciehanski's full-sized avatar

Ryan Ciehanski ciehanski

View GitHub Profile
@siburu
siburu / go-delete-slice-elements-in-loop.go
Created December 7, 2015 07:31
You must use a downward loop
// http://stackoverflow.com/questions/29005825/how-to-remove-element-of-struct-array-in-loop-in-golang
package main
func correctDeletion() {
var array [10]int
for i, _ := range array {
array[i] = i
}
s := array[:]
@mskutta
mskutta / EdgeRouter_IPv6_Commands_for_Comcast.txt
Last active October 7, 2024 02:45
EdgeRouter IPv6 Commands for Comcast
configure
# Configure Firewall
set firewall ipv6-name IPV6WAN_IN description 'IPV6WAN to internal'
set firewall ipv6-name IPV6WAN_IN default-action drop
set firewall ipv6-name IPV6WAN_IN rule 10 action accept
set firewall ipv6-name IPV6WAN_IN rule 10 state established enable
set firewall ipv6-name IPV6WAN_IN rule 10 state related enable
set firewall ipv6-name IPV6WAN_IN rule 10 log disable
@mandiwise
mandiwise / Count lines in Git repo
Last active May 1, 2025 06:01
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
@brandonpittman
brandonpittman / ToggleSpellcheck.vim
Last active November 18, 2022 12:59
Toggle spellcheck on/off in vim
" Toggle spellchecking
function! ToggleSpellCheck()
set spell!
if &spell
echo "Spellcheck ON"
else
echo "Spellcheck OFF"
endif
endfunction
@pascalpoitras
pascalpoitras / 1.md
Last active May 1, 2025 10:42
My WeeChat configuration

This configuration is not maintained anymore. You should think twice before using it, Breaking change and security issue will likely eventually happens as any abandonned project.

@artyom
artyom / resave.go
Created November 25, 2013 12:41
Remove EXIF data from image by resaving it.
package main
import (
"image"
"image/jpeg"
"log"
"os"
)
func main() {
@minikomi
minikomi / filebuffer.go
Created June 9, 2012 10:27
Read file to buffered bytes buffer in chunks.
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"log"
"os"
)