Skip to content

Instantly share code, notes, and snippets.

View marcelbeumer's full-sized avatar

Marcel Beumer marcelbeumer

View GitHub Profile
@marcelbeumer
marcelbeumer / step1.png
Last active June 14, 2022 20:10
gopls lsp screenshots
screenshots
@marcelbeumer
marcelbeumer / lsp.log
Created October 21, 2021 11:17
lsp.log for codenav issue with nvim
[START][2021-10-21 13:16:21] LSP logging initiated
[INFO][2021-10-21 13:16:26] .../vim/lsp/rpc.lua:258 "Starting RPC client" {
args = { "lsp" },
cmd = "deno",
extra = {}
}
[TRACE][2021-10-21 13:16:26] .../lua/vim/lsp.lua:843 "LSP[denols]" "initialize_params" {
capabilities = {
callHierarchy = {
dynamicRegistration = false
@marcelbeumer
marcelbeumer / color.ts
Last active July 30, 2020 15:41
Super minimal color util lib
// Based on:
// https://github.com/styled-components/polished
// https://github.com/bgrins/TinyColor
export interface Rgba {
r: number;
g: number;
b: number;
a: number;
}
// video player api code
setContent(content: VideoContent) {
// ...
videoJsPlayer.src(sources)
// ...
tracker({ content, type: 'contentChanged' })
},
// our player tracker code that gets a contentChange event
this.player.on('timeupdate', function() {
// PATCHED BY [email protected]:
// - fix errors when HLS does not have resolution info
var a = this
clearTimeout(n),
(s = !1),
Date.now(),
i.eventCallback(l.Event.TIMECHANGED, { currentTime: this.currentTime() })
var r = this.tech_.hls.playlists.media()
if (r) {
{
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
"Action": "s3:*",
[[NSURLCache sharedURLCache] removeAllCachedResponses];
[self setDefaultWebViewUserAgent];
IOLSession *defaultSession = [IOLSession defaultSession];
NSString *multiIdentifier = [IOLWebView multiIdentifierStringWithSession:defaultSession];
NSString *XXXmultiIdentifier = @"{\"library\":{\"libVersion\":\"1.1.6\",\"configVersion\":\"2013093000\",\"offerIdentifier\":\"apptasty\"},\"client\":{\"uuids\":{\"advertisingIdentifier\":\"1d0da3eaab430551d5129539aefbd8e2\"},\"osIdentifier\":\"iOS\",\"osVersion\":\"8.3\",\"network\":\"2\",\"carrier\":\"o2-de\",\"screen\":{\"resolution\":\"320x568\",\"scale\":2},\"country\":\"NL\",\"language\":\"nl\",\"platform\":\"iPhone5,2\"}}";
NSData *multiIdentifierData = [multiIdentifier dataUsingEncoding:NSUTF8StringEncoding];
NSData *base64multiIdentifierData = [multiIdentifierData base64EncodedDataWithOptions:0];
title date tags
Generators in JS
2014-08-12 11:10:08 +0200
generators, js, async

Generators are function executions that can be suspended and resumed.

It's supported in Firefox and node 0.11 with --harmony, unclear when it gets to stable. You can also transpile using traceur or regenerator.

@marcelbeumer
marcelbeumer / gist:6591578
Last active December 23, 2015 06:08
Work in progress VIM GotoFile enhancer
function! EditIncludeOnLine()
let line = getline('.')
if exists("b:edit_include_line_parser")
let GrabFn = function(b:edit_include_line_parser)
let line = call(GrabFn, [line])
endif
let path = line
if exists("b:edit_include_path_resolver")
let ResolveFn = function(b:edit_include_path_resolver)
let path = call(ResolveFn, [line])
@marcelbeumer
marcelbeumer / gist:5652379
Created May 26, 2013 10:34
Clear tmux pane with ctrl-k (like cmd-k clears a terminal) without polluting the bash history.
:bind-key -n C-k send-keys "clear && tmux clear-history; history -d $((\$HISTCMD-1))" \; send-keys "Enter"