Skip to content

Instantly share code, notes, and snippets.

" Called with a command and a redirection target
" (see `:help redir` for info on redirection targets)
" Note that since this is executed in function context,
" in order to target a global variable for redirection you must prefix it with `g:`.
" EG call Redir('ls', '=>g:buffer_list')
funct! Redir(command, to)
exec 'redir '.a:to
exec a:command
redir END
endfunct

How to Fix Unread Favicon in GMail for Chrome

  • Ensure Labs => Unread Message Icon feature enabled
  • Install "TamperMonkey" chrome plugin
  • Add the javascript included in this gist (fix_gmail_unread_favicon.js)

Thanks to Bertrand Schneider for the code snippet and fix.

Why did the favicon break?

@ignlg
ignlg / setup.bash
Last active May 26, 2017 10:40
Setup Mac OS X from scratch using Homebrew & Cask
#!/usr/bin/env bash
###
#
# Setup Mac OS X from scratch using Homebrew & Cask
#
# Version: 1.2.31
# Date: 20151207
# Author: Ignacio Lago @ignlg
# Gist: https://gist.github.com/ignlg/691cb662e92c41289a03
@siamak
siamak / gradient.js
Last active April 5, 2019 11:09
Steps in Gradient
/**
* GradientArray • Steps gradient.
* @author Siamak Mokhtari <hi@siamak.work>
* @date 06/21/16.
*/
class GradientArray {
// Convert a hex color to an RGB array e.g. [r,g,b]
// Accepts the following formats: FFF, FFFFFF, #FFF, #FFFFFF
hexToRgb(hex) {
let r, g, b, parts;
anonymous
anonymous / scratch_4.js
Created October 20, 2016 11:59
var browserSync = require('browser-sync').create();
browserSync({
proxy: 'https://www.wikipedia.org/',
files: ['assets/**'],
serveStatic: ['assets'],
rewriteRules: [
{
match: 'portal/wikipedia.org/assets/js/index-6adef12f4f.js',
replace: '/js/index.js'
@barbietunnie
barbietunnie / udemy-courses-download-using-cookies.md
Last active July 8, 2024 04:41
Downloading Udemy videos with youtube-dl

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@soupi
soupi / Json.hs
Last active November 11, 2019 19:34
A simple JSON EDSL
{- | An EDSL for defining and printing JSON values
-}
import Data.List (intercalate)
----------------
-- JSON Model --
----------------
-- | The JSONValue data type represents a JSON Value
;;; search-with-llama.el --- Find an answer to your query using llama! -*- lexical-binding: t; -*-
;; Copyright (C) 2023 Kiran Gopinathan
;; Author: Kiran Gopinathan
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or