Skip to content

Instantly share code, notes, and snippets.

@tamirvs
tamirvs / MyComponent.vue
Created February 11, 2020 21:01
Mixin to make the back button close dialogs
<template>
<v-dialog v-model="dialog">
...
</v-dialog>
</template>
<script>
import backButton from './mixins/backButton.js';
export default {
@rodaine
rodaine / bench.txt
Last active December 12, 2019 02:27
Code snippets for my blog post "The X-Files: Avoiding Concurrency Boilerplate with golang.org/x/sync"
BenchmarkMutexCache/10-8 10000000 180 ns/op 0 B/op 0 allocs/op
BenchmarkMutexCache/100-8 10000000 187 ns/op 0 B/op 0 allocs/op
BenchmarkMutexCache/1000-8 10000000 214 ns/op 0 B/op 0 allocs/op
BenchmarkMutexCache/10000-8 10000000 231 ns/op 0 B/op 0 allocs/op
BenchmarkMutexCache/100000-8 5000000 254 ns/op 2 B/op 0 allocs/op
BenchmarkMutexCache/1000000-8 1000000 1159 ns/op 102 B/op 1 allocs/op
BenchmarkMutexCache/10000000-8 1000000 1481 ns/op 184 B/op 2 allocs/op
BenchmarkMutexCache/100000000-8 1000000 1655 ns/op 187 B/op 3 allocs/op
BenchmarkSyncMapCache/10-8 5000000 221 ns/op 0 B/op 0 allocs/op
@stebennett
stebennett / feeds.opml
Created August 12, 2016 15:24
The feeds I currently subscribe to.
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Stephen subscriptions in feedly Cloud</title>
</head>
<body>
<outline text="Companies" title="Companies">
<outline type="rss" text="Trello" title="Trello" xmlUrl="https://trello.engineering/feed.xml" htmlUrl="http://tech.trello.com/"/>
<outline type="rss" text="IMVU" title="IMVU" xmlUrl="http://engineering.imvu.com/feed/" htmlUrl="https://engineering.imvu.com"/>
@abhijeetchopra
abhijeetchopra / 0-README.md
Last active April 24, 2024 20:40
Creating automatic scheduled backup copies of your Google Sheets using Google Apps Script

How to "Schedule Automatic Backups" of your Google Sheets

This tutorial demonstrates how to use Google Apps Script to:

  • Create copies of the Google Sheet in the desired destination folder automatically at set intervals.

  • Append the time stamp with each backup file's name.

  • Adjust time trigger for backing up every day/hour/minute.

@ndelitski
ndelitski / 1.yml
Created November 30, 2015 15:03
drone.yml examples
clone:
path: github.com/gogits/gogs
build:
image: golang:$$GO_VERSION
environment:
- TAGS="pam sqlite"
- BUILD_OS="windows linux darwin freebsd openbsd netbsd"
@roachhd
roachhd / productkey.vbs
Created August 7, 2015 14:40
Find your product key for Windows OS
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
@kgorskowski
kgorskowski / coreos-efs-cloud-config
Created July 10, 2015 10:37
coreos cloud-config file for dynamically mount aws efs in the right availability zone
#cloud-config
write-files:
- path: /etc/conf.d/nfs
permissions: '0644'
content: |
OPTS_RPC_MOUNTD=""
users:
- name: XYZ
groups:
@philipz
philipz / gist:67892bdc8a385ecb3b8c
Last active November 14, 2017 22:57
Rsync & Docker save

Rsync & Docker save

docker save $1 > $1.tar && rsync -ravP -e ssh $1.tar philipz@192.168.2.51:/home/philipz/tmp && rm $1.tar ##Add Gzip docker save busybox | gzip -c - > busybox.tar.gz

gzip -d busybox.tar.gz && docker load < busybox.tar

docker save busybox | gzip | pv | ssh -i ~/.ssh/id_rsa USER@HOSTNAME sudo docker load

@vsouza
vsouza / .bashrc
Last active April 9, 2024 05:27
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@jpillora
jpillora / sshd.go
Last active December 17, 2023 16:27
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client: