Skip to content

Instantly share code, notes, and snippets.

View ik5's full-sized avatar
🎯
Focusing

ik5 ik5

🎯
Focusing
View GitHub Profile
@teddyking
teddyking / waitgroup.go
Created August 23, 2016 10:34
Example of Go sync.WaitGroup
package main
import (
"fmt"
"sync"
"time"
)
func main() {
var myWaitGroup sync.WaitGroup
@iamralch
iamralch / golang_pprof.go
Last active June 23, 2020 03:22
A code snippet that demonstrates how to use custom pprof profiles
package main
import (
"bufio"
"fmt"
"net/http"
pprofHTTP "net/http/pprof"
"os"
"runtime/pprof"
"strings"
@iamralch
iamralch / searchr.go
Created July 11, 2015 11:50
searchr - a sample application that works with pipes
package main
import (
"bufio"
"flag"
"fmt"
"io"
"os"
"strings"
)
https://www.typescriptlang.org/play?ts=4.1.0-dev.20200921#code/PQKhCgAIUgDeo0oENJVvcyKMa3-B2OaWx6pikgCaSCJpHfQzYDGktjjThnrb9LPDfJpUiAA0jEjAEaQ0J4kdWmzFnLgsXj5MtVMHD8tDnubLjhfSbOnm+3Xgu3pZTETIbH8gwX3Xolj1m78fPx0QcGCKjo+nkYEauLaonHqiXHatBLEacw2-jEm9n75yl7BId5IhoXOGAlF1egJWqquZDnu0aVVKp3FMQE8QlGxnEnJdaNiJnJ4EyKU8LCUlAAqABYAlgDOkFuQAIaQAMoAigAykAAmewAuewBGe5sApjsAtgAOADZPr08AdtcnhdIO8AK4AJyenwAnjs-pBltD3k9DgBjcHrd7XSDXJEvPZ-P4Ae1u13WRL+mwAdCsNttfgTttdVjcdtiicjwTcnttNkTvjDIBScXjtgBaSDQomgy5PABm6z++MgACIrrcHs8VQAaSgACgAVqDNtiDrjkftCSSbuS-gBKS3A5n-SAAR1BT3BsPW2ONioA5pA+b9IK8iZCRRaCcTSbbqZQAJLYzag97vcPXbYHFN3Z7suVHM7auGoz6gi4Bo4AUVOVYAwstIHqAO4+1aQVEUitkinbABkkANRMVmztup8CYAcocqwAlZbFgCqAAUACIAQWWVcdkFXNarW6DpJ+-0zNJ8tN273BRINT1R2M+6wAbjz9tjVtdru9NgAuYDAP6bagncVKdq8wCdhcPzrAAHsAmZipsrqfJQPqQM2jwYRiX4uncsJ1iy4LfNsy7rKiADWTYdkRJEAAJQTBsFgUSrzFp+35-gB1ytrh4IsRBqIAPrvORVF2ueMCUAAmtKHYEnCJp7J8nw4psSEoXCkrSuCQrNvC163ve2K8e2sB-O8ryKbcKmQAxRLQa8cEIepyGfLAQrgvM0J7OC8IjjZqn2Y5zmIW5Hl6oiyJohiWKQAALFSACMOzbJC7rrJCFwSUsPiRZiv6QKs
#include <stdio.h>
#include <string.h>
#include <pulse/pulseaudio.h>
// Field list is here: http://0pointer.de/lennart/projects/pulseaudio/doxygen/structpa__sink__info.html
typedef struct pa_devicelist {
uint8_t initialized;
char name[512];
uint32_t index;
char description[256];
@iamralch
iamralch / context.go
Created November 20, 2015 13:05
An example that illustrates how to work with https://godoc.org/golang.org/x/net/context
package main
import (
"bufio"
"fmt"
"os"
"strings"
"time"
"golang.org/x/net/context"
@dlants
dlants / denite.md
Last active March 5, 2021 06:13
denite setup with interactive ag pattern-search of project contents

Files

First things first, I want to use ag to search through my project files. Coming from fzf, I like to have two bindings for this -- one that respects my projects .gitignore and one that does not. The latter is helpful if I want to examine a built file or look at a node_module dependency while working on my js project.

I use an alias for file_rec source to toggle the -u flag on ag. Now, <C-P> searches in my git files, and <C-O> searches everything.

" denite file search (c-p uses gitignore, c-o looks at everything)
map <C-P> :DeniteProjectDir -buffer-name=git -direction=top file_rec/git<CR>
map  :DeniteProjectDir -buffer-name=files -direction=top file_rec
function RenameWithQuickfix()
local position_params = vim.lsp.util.make_position_params()
local new_name = vim.fn.input "New Name > "
position_params.newName = new_name
vim.lsp.buf_request(0, "textDocument/rename", position_params, function(err, method, result, ...)
-- You can uncomment this to see what the result looks like.
if false then
print(vim.inspect(result))
@linxGnu
linxGnu / gosmpp_sample.go
Created September 13, 2019 00:38
Connect to SMSC for sending MT and receiving MO via Session Manager
package daemon
import (
"context"
"fmt"
"math"
"os"
"strconv"
"sync"
"time"
@aaronst
aaronst / unc1878_indicators.txt
Created October 28, 2020 20:20
UNC1878 Indicators
# C2 FQDNs
first seen fqdn
2019-12-11 23:37:10 updatemanagir.us
2019-12-20 17:51:05 cmdupdatewin.com
2019-12-26 18:03:27 scrservallinst.info
2020-01-10 00:33:57 winsystemupdate.com
2020-01-11 23:16:41 jomamba.best
2020-01-13 05:13:43 updatewinlsass.com
2020-01-16 11:38:53 winsysteminfo.com
2020-01-20 05:58:17 livecheckpointsrs.com