Skip to content

Instantly share code, notes, and snippets.

@jglick
jglick / uc-grep
Last active January 27, 2023 07:06
#!/bin/bash
PLUGIN=$1
VERSION=$2
UC=$3
if [ -z "$PLUGIN" ]
then
echo 'Usage: uc-grep short-name [core-version [https://jenkins-updates.cloudbees.com/update-center/envelope-core-mm/]]'
exit 1
fi
if [ -z "$VERSION" ]
@dmitshur
dmitshur / gist:6927554
Last active September 17, 2023 07:35
[Legacy GOPATH mode] How to `go get` private repos using SSH key auth instead of password auth.

WARNING: This gist was created in 2013 and targets the legacy GOPATH mode. If you're reading this in 2021 or later, you're likely better served by reading https://tip.golang.org/cmd/go/#hdr-Configuration_for_downloading_non_public_code and https://golang.org/ref/mod#private-modules.

$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@xymostech
xymostech / chromium-no-ctrl-scroll-zoom.patch
Created March 10, 2013 01:28
Make Chromium not scroll on ctrl-zoom. Use these patch files on the source directory, and then build.
--- content/browser/web_contents/web_contents_view_gtk.cc.orig 2013-03-09 20:16:51.437945192 -0500
+++ content/browser/web_contents/web_contents_view_gtk.cc 2013-03-09 20:16:56.151278267 -0500
@@ -56,6 +56,8 @@
// See tab_contents_view_views.cc for discussion of mouse scroll zooming.
gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event,
WebContentsImpl* web_contents) {
+ return FALSE;
+
if ((event->state & gtk_accelerator_get_default_mod_mask()) !=
GDK_CONTROL_MASK) {
@jglick
jglick / git-grep-dired.el
Created July 24, 2012 20:46
M-x git-grep-dired: Emacs command to search for text patterns in a Git repo à la find-grep-dired
(defun git-grep-dired (repo wildcards regexp)
"Find Git-controlled files in DIR with a name like WILDCARDS containing a regexp REGEXP and start Dired on output."
(interactive "DGit-grep (directory): \nsGit-grep (filename wildcard(s), e.g. *.xml): \nsGit-grep (grep regexp): ")
(setq repo (file-name-as-directory (expand-file-name repo)))
(switch-to-buffer (concat "*Git Grep " repo "*"))
(fundamental-mode)
(setq buffer-read-only nil)
(erase-buffer)
(setq default-directory repo)
(let ((cmd (format "git --git-dir %s/.git ls-files -z%s | xargs -0 grep -lZ -- %s | xargs -0 ls -l"