Skip to content

Instantly share code, notes, and snippets.

View indigoviolet's full-sized avatar
🐈

Venky Iyer indigoviolet

🐈
View GitHub Profile
@indigoviolet
indigoviolet / add-github-buttons-to-graphite
Last active November 16, 2023 19:47 — forked from benjaffe/add-github-buttons-to-graphite
JS to add Github buttons to Graphite (especially great with Arc Browser Boosts)
function isGraphitePr() {
return window.location.hostname === 'app.graphite.dev' && window.location.pathname.includes('/github/pr/')
}
function makeGithubPrUrl() {
const pieces = window.location.pathname.replace('/github/pr/', '').split('/');
return `https://github.com/${pieces[0]}/${pieces[1]}/pull/${pieces[2].split('/')[0]}/`;
}
// fn determines whether the element should hide itself
@indigoviolet
indigoviolet / detectron2-tutorial.ipynb
Last active February 20, 2024 20:11
Detectron2 Tutorial.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
otImplementedError Traceback (most recent call last)
<ipython-input-19-d720bdf83541> in <module>()
18 trainer.resume_or_load(resume=False)
19 wandb.watch(trainer.model)
---> 20 trainer.train()
12 frames
/usr/local/lib/python3.6/dist-packages/detectron2/engine/defaults.py in train(self)
399 OrderedDict of results, if evaluation is enabled. Otherwise None.
400 """
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
config.ru
Rakefile
Vagrantfile
Gemfile
.pryrc
app/mailers/messager_mailer.rb
app/mailers/fin_mailer.rb
app/mailers/smoke_test_mailer.rb
app/mailers/user_mailer.rb
app/mailers/remote_task_mailer.rb
with weekends AS (
-- generate all weekends between 2017-01-01 and next weekend
select
DATEADD(day, 7*n, '2017-01-01') AS ref_date,
CAST(NEXT_DAY(DATEADD(day, 7*n, '2017-01-01'), 'Saturday') AS timestamp) AS saturday,
CAST(NEXT_DAY(DATEADD(day, 7*n, '2017-01-01'), 'Sunday') AS timestamp) + interval '86399 second' AS sunday
from numbers
where DATEADD(day, 7*n, '2017-01-01') <= getdate() + interval '7 day'
diff --git a/app/services/team_service.rb b/app/services/team_service.rb
index 87a28ad7ed..3cfd9a99bc 100644
--- a/app/services/team_service.rb
+++ b/app/services/team_service.rb
@@ -1,13 +1,8 @@
# frozen_string_literal: true
-class TeamService
+module TeamService
include C
@indigoviolet
indigoviolet / date bookmarklet.js
Last active March 1, 2017 02:13 — forked from shanechin1/date bookmarklet.js
PRs updated in last 7 days bookmarklet
javascript: (function(){
var d = new Date();
d.setDate(d.getDate() - 7);
window.location.href="https://github.com/pulls?utf8=✓&q=is%3Aopen+is%3Apr+involves%3Aindigoviolet+sort%3Aupdated-desc+user%3Afinventures+updated%3A>"+d.toISOString().substring(0, 10)
}());
/* I previously used the other comment style, which broke the bookmarklet */
@indigoviolet
indigoviolet / postgres_queries_and_commands.sql
Created November 15, 2016 00:26 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import os
cfiles = filter(None, [c.strip() for c in """
src/analyze-linkage.c
src/and.c
src/api.c
src/build-disjuncts.c