Skip to content

Instantly share code, notes, and snippets.

@digitalmoksha
digitalmoksha / fix-links.lua
Created September 30, 2022 15:36 — forked from MyriaCore/fix-links.lua
How to use pandoc with gitlab markdown
@digitalmoksha
digitalmoksha / travis.yml
Created June 9, 2019 16:42
Sample `.travis.yml` for running test on Ruby/Rubymotion gems
# test against both regular Ruby and RubyMotion
language: ruby
cache:
- bundler
# latest stable/supported versions
rvm:
- 2.4.6
- 2.5.5
- 2.6.3
# digitalmoksha - added the ability to show the repos email address
# If you would like to the email address used to commit code, then you can set
# GIT_PS1_SHOWEMAIL to a nonempty value.
#------------------------------------------------------------------------------
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.

Keybase proof

I hereby claim:

  • I am digitalmoksha on github.
  • I am digitalmoksha (https://keybase.io/digitalmoksha) on keybase.
  • I have a public key ASDyGludJYeVdnN3qjMPN0Ar_x4MQ89X8P6nHBG7eeQy6go

To claim this, I am signing this object:

#!/usr/bin/env ruby
#
# Merge multiple git repositories into a new one.
# Users `git filter-branch` to rewrite paths, so that `git log` works seamlessly
# Built from the script at http://dominik.honnef.co/posts/2016/04/merging-git-repositories/
#------------------------------------------------------------------------------
new_repo = '/tmp/new_repo'
base = 'git@github.com:customer'
dest_branch = 'master'
@digitalmoksha
digitalmoksha / backupsql.rb
Last active August 20, 2016 14:39
Backup MySQL databases and sync to S3
#!/usr/bin/env ruby
# Backup specified databases - place in a cron job
# Previously we used sftp to save files to a remote server.
# Now sync directly with a bucket on AWS S3
#
# Use a MySQL configuration file (.cnf) to store the password, so that it doesn't
# appear in the process list
#
# example.cnf
@digitalmoksha
digitalmoksha / gist:051a00c1448395f1be4a
Created February 19, 2015 16:49
Attempts to demonstrate a potential issue with regular expressions between Ruby and RubyMotion
# The following code attempts to demonstrate a potential issue with regular
# expressions between Ruby and RubyMotion.
#
# The expression is supposed to match the text before an end of block character (^)
# So
#
# x = Class.new
# ^
#
# should only return the first line, while
@digitalmoksha
digitalmoksha / svn_autocommit.rb
Created July 10, 2014 13:20
Add / Remove / Commit files to subversion (svn) automatically
#!/usr/bin/env ruby
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
def usage
puts ""
puts "usage: #{File.basename( __FILE__ )} [-t] PATH"
puts ""
puts "Automatically commits the changes of svn working copy located in PATH."