Skip to content

Instantly share code, notes, and snippets.

View Abby3017's full-sized avatar

abhinav kumar Abby3017

View GitHub Profile
@Abby3017
Abby3017 / FileManager.java
Last active April 23, 2020 12:17
In React Native directory move is not provided, react-native-fs and react-native-fetch-blob fail to provide any interface for that. This is native way to do that
package com.abhinav;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import com.abhinav.FileModule;
import java.util.ArrayList;
import java.util.Collections;
@xeoncross
xeoncross / middleware.go
Last active April 30, 2021 20:22
Simple example of using http middleware in Go (golang)
package main
import (
"fmt"
"log"
"net/http"
"os"
)
// Adapter wraps an http.Handler with additional
@ra0van
ra0van / bash_script_workon.sh
Last active February 17, 2018 20:37
bash script to enable workon command for virtualenvwrapper
#add workon home path
export WORKON_HOME=~/.virutalenvs
VIRTUALENVWRAPPER_PYTHON='/usr/bin/python'
source /usr/local/bin/virtualenvwrapper.sh
@goncalvesjoao
goncalvesjoao / Gemfile
Last active November 13, 2020 01:52
Changes you need to make in order to make Devise use JWT Header Authentication
# Add the "https://github.com/jwt/ruby-jwt" gem to your "Gemfile"
gem 'jwt'
@hezhao
hezhao / django_cmd.sh
Last active May 1, 2024 07:22
Django Commands Cheatsheet
# Use Python 3 for easy unicode
$ virtualenv -p python3 .env
$ source .env/bin/activate
$ pip install django
$ deactivate
# Start new django project and app
$ django-admin.py startproject mysite
$ ./manage.py migrate
$ ./manage.py createsuperuser
@brock
brock / psql-with-gzip-cheatsheet.sh
Last active June 27, 2024 10:09
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@wrburgess
wrburgess / gist:5528649
Last active November 24, 2022 15:29
Backup Heroku Postgres database and restore to local database

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production