Skip to content

Instantly share code, notes, and snippets.

View tejainece's full-sized avatar

Ravi Teja Gudapati tejainece

View GitHub Profile
@tejainece
tejainece / .vimrc
Last active June 27, 2023 11:44
My .vimrc
filetype plugin indent on
syntax on
set autoread
set autowrite
set number
" Enable mouse
set mouse=a
@tejainece
tejainece / tmux-cheatsheet.markdown
Created November 16, 2019 16:40 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@tejainece
tejainece / postgres-cheatsheet.md
Created June 2, 2019 14:39 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@tejainece
tejainece / postgres_cheat_sheet
Created June 1, 2019 20:42 — forked from johnnyjung/postgres_cheat_sheet
Postgres Cheat Sheet
Postgres Cheat Sheet
Source: Postgresql Documentation
### shell commands
creatuser <user>
deletesuer <user>
createdb -O <user> -E utf8 -T <template> <db_name>
dropdb <db_name>
@tejainece
tejainece / install_kube.sh
Last active January 25, 2019 22:19
Install kubernetes on Ubuntu
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add
sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
sudo apt install kubeadm
class Endpoint {
constructor(path: String) {
}
fun query(key: String, defaultValue: String = "", valueExample: String = "", description: String = "") {
}
}
fun post(path: String, func: Endpoint.()->Unit): Endpoint {
return Endpoint(path)
@tejainece
tejainece / radius_search.sql
Last active August 21, 2018 13:24
Experimenting with radius search using postgis.
/* Enable postgis */
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE TABLE ex1 (
id VARCHAR(10) NOT NULL,
loc geography(POINT, 4326)
);
CREATE INDEX ex1_loc_gix ON ex1 USING GIST (loc);
@tejainece
tejainece / auth.dart
Last active May 26, 2021 08:44
Examples on Jaguar website
import 'package:jaguar/jaguar.dart';
import 'package:jaguar_auth/jaguar_auth.dart';
import 'package:jaguar_example_session_models/jaguar_example_session_models.dart';
main() async {
final server = Jaguar(port: 10000);
// Register user fetcher
server.userFetchers[User] = DummyUserFetcher(users);
server.postJson(
import 'dart:async';
Stream<int> stream() async* {
int k = 0;
while (k < 10) yield k++;
}
void main() async {
await for(int i in stream()) {
print('Starting $i ...');
@tejainece
tejainece / liblinear_vs_lightning.py
Created June 4, 2018 14:09 — forked from arthurmensch/liblinear_vs_lightning.py
SAGAClassifier vs sklearn liblinear
import numpy as np
from lightning.classification import SAGAClassifier
from scipy import sparse
from sklearn.datasets import load_iris, make_classification
from sklearn.linear_model.logistic import (
LogisticRegression,
)