Skip to content

Instantly share code, notes, and snippets.

@talmobi
talmobi / grep.md
Created May 7, 2022 11:32 — forked from romainl/grep.md
Instant grep + quickfix

FOREWORDS

I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.

My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.


Instant grep + quickfix

from command: ~/Downloads/Chromium.app/Contents/MacOS/Chromium --enable-logging=stderr --v=1 >log.txt 2>&1
macOS 10.12.6 (16G29) Using no-sync Chromium 79.0.3945.130 (706915).
page crash on trying to play youtube video: https://www.youtube.com/watch?v=Gu2pVPWGYMQ
[1343:775:0130/215132.382320:VERBOSE1:webrtc_event_log_manager.cc(99)] WebRTC remote-bound event logging enabled.
[1343:775:0130/215132.383165:VERBOSE1:pref_proxy_config_tracker_impl.cc(184)] 0x7f9405d44640: set chrome proxy config service to 0x7f9405f59c70
[1343:775:0130/215132.448207:WARNING:account_consistency_mode_manager.cc(286)] Desktop Identity Consistency cannot be enabled as no OAuth client ID and client secret have been configured.
[1343:775:0130/215132.448453:WARNING:account_consistency_mode_manager.cc(286)] Desktop Identity Consistency cannot be enabled as no OAuth client ID and client secret have been configured.
@talmobi
talmobi / README.md
Created September 18, 2018 12:55 — forked from joyrexus/README.md
Node.js streams demystified

A quick overview of the node.js streams interface with basic examples.

This is based on @brycebaril's presentation, Node.js Streams2 Demystified

Overview

Streams are a first-class construct in Node.js for handling data.

Think of them as as lazy evaluation applied to data.

@talmobi
talmobi / consumer.js
Created September 18, 2018 12:06 — forked from skeggse/consumer.js
A Node.js backpressure example over a tcp/net stream. Just run index.js, the output is a little shoddy but it works. The producer only produces once the consumer catches up, but the streams are disconnected--they can't communicate directly.
var net = require('net');
var util = require('util');
var Writable = require('stream').Writable;
/**
* Pretends to consume the data written to it. In reality, it just eats data
* really slowly.
*
* @constructor
* @extends Writable
@talmobi
talmobi / preview.sh
Created March 31, 2018 10:45 — forked from sander1/preview.sh
Video preview script from https://davidwalsh.name/video-preview
sourcefile=$1
destfile=$2
# Overly simple validation
if [ ! -e "$sourcefile" ]; then
echo 'Please provide an existing input file.'
exit
fi
if [ "$destfile" == "" ]; then
@talmobi
talmobi / appointment.ts
Created October 20, 2017 13:47 — forked from gautamsi/appointment.ts
Fetch Appointments using ews-javascript-api
import { ExchangeService, ExchangeVersion, ExchangeCredentials, Uri, DateTime, CalendarView, WellKnownFolderName, EwsLogging } from "ews-javascript-api";
import credentials = require("./credentials"); //for username and password
EwsLogging.DebugLogEnabled = false;
var service = new ExchangeService(ExchangeVersion.Exchange2010);
service.Credentials = new ExchangeCredentials(credentials.userName, credentials.password);
service.Url = new Uri("https://outlook.office365.com/Ews/Exchange.asmx");
var view = new CalendarView(DateTime.Now.Add(-1, "week"), DateTime.Now); // appointments in last one week.
#!/bin/bash
EXECUTE=0
VERBOSITY=0
function log {
if [[ $VERBOSITY -ge 1 ]]; then
echo "$@"
fi
}
@talmobi
talmobi / convert.sh
Created September 7, 2017 19:00
bash script to convert avi to mp4 with ffmpeg
#!/bin/bash
# Usage: ./convert.sh file
for arg; do
echo ""
echo "arg: $arg"
inputFile=$arg
outputFile="$inputFile.output.mp4"
@talmobi
talmobi / browserify_for_webpack_users.markdown
Created May 25, 2017 21:57
browserify for webpack users

browserify for webpack users

There's been a strange explosion in misinformation about browserify recently, particularly in comparisons to webpack.

Generally speaking, most of this confusion stems from how webpack is more willing to pull features into its core to ease discoverability while browserify is more likely to push features out to userland instead.

I think that longer-term, separability has more benefits from a maintenance and

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.176470547914505</real>