Skip to content

Instantly share code, notes, and snippets.

View nathmisaki's full-sized avatar

Nathalia Misaki nathmisaki

View GitHub Profile
@nathmisaki
nathmisaki / block_personal_appts
Created January 10, 2020 01:30 — forked from ttrahan/block_personal_appts
Google Apps Script to automatically create, edit and delete events on work calendar for personal calendar events. Instructions on how to set up can be found at https://medium.com/@willroman/auto-block-time-on-your-work-google-calendar-for-your-personal-events-2a752ae91dab
function sync() {
var id="XXXXXXXXXX"; // CHANGE - id of the secondary calendar to pull events from
var today=new Date();
var enddate=new Date();
enddate.setDate(today.getDate()+7); // how many days in advance to monitor and block off time
var secondaryCal=CalendarApp.getCalendarById(id);
var secondaryEvents=secondaryCal.getEvents(today,enddate);
@nathmisaki
nathmisaki / resque_tips.rb
Last active December 30, 2016 19:01 — forked from clemens/resque_retry.rb
Resque 1.x Swiss Army Tool
# inspired by http://ariejan.net/2010/08/23/resque-how-to-requeue-failed-jobs
# retry all failed Resque jobs except the ones that have already been retried
# This is, for instance, useful if you have already retried some jobs via the web interface.
Resque::Failure.each { |i, j| Resque::Failure.requeue(i) unless j['retried_at'].present? }; nil
# retry all :)
Resque::Failure.each { |i, j| Resque::Failure.requeue(i) }; nil
# Clear retried jobs
#!/bin/bash
## START PRECOMMIT HOOK
files_modified=`git status --porcelain | egrep "^(A |M |R ).*" | awk ' { if ($3 == "->") print $4; else print $2 } '`
[ -s "$HOME/.rvm/scripts/rvm" ] && . "$HOME/.rvm/scripts/rvm"
## use ruby defined in project
source .rvmrc
for f in $files_modified; do
#!/bin/bash
## START PRECOMMIT HOOK
files_modified=`git status --porcelain | egrep "^(A |M |R ).*" | awk ' { if ($3 == "->") print $4; else print $2 } '`
[ -s "$HOME/.rvm/scripts/rvm" ] && . "$HOME/.rvm/scripts/rvm"
## use ruby defined in project
[ -s ".rvmrc" ] && source .rvmrc
if [ -s ".ruby-version" ]; then
_rvmrc="$(cat .ruby-version)"
Vim #ftw but manage vim plugins is not a task that I like.
Let's change that:
A Fake bash commands:
$ vim-apt list
$ vim-apt update # Update and see new versions of that package (like apt-get update)