Skip to content

Instantly share code, notes, and snippets.

View madhikarma's full-sized avatar

Shagun Madhikarmi madhikarma

View GitHub Profile
@madhikarma
madhikarma / gist:3e5eedfca94ff2939b53b3dc7531b1ee
Created December 22, 2022 19:52
Python Django Cheatsheet
# Taken from https://dev.to/ericchapman/my-beloved-django-cheat-sheet-2056
# Create et access project folder
~$ mkdir project_name
~$ cd project_name
# Create Python virtual env
~$ python3 -m venv venv
# Activate virtual env
@madhikarma
madhikarma / example json schema person
Created April 15, 2022 06:36
example json schema person
{
"$id": "https://example.com/person.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Person",
"type": "object",
"properties": {
"firstName": {
"type": "string",
"description": "The person's first name."
},
@madhikarma
madhikarma / git-remove-examples.sh
Created October 16, 2019 05:11
Git remove files/text from history snippet
# Remove folder (tested)
git filter-branch --tree-filter 'rm -rf FOLDER_PATH' --prune-empty HEAD
# Remove file (not tested)
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch FILE_PATH" \
--prune-empty --tag-name-filter cat -- --all
# Remove text (not tested)
git filter-branch --tree-filter "find . -type f -exec sed -i -e 's/ORIGINAL_PASSWORD/NEW_PASSWORD/g' {} \;"
@madhikarma
madhikarma / android-setup.sh
Created January 2, 2018 07:46
Android setup notes
export ANDROID_HOME=/YOUR_PATH_TO/android-sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
@madhikarma
madhikarma / sample_login_api_response.json
Created May 6, 2017 09:44
sample_login_api_response.json
{
"token": "c3fcd3d76192e4007dfb496cca67e13b"
}
@madhikarma
madhikarma / request.rb
Last active January 22, 2017 14:42
Ruby HTTP request
# To use save this file, open a terminal at its location and execute `ruby request.rb`
require 'net/http'
require 'json'
url = "https://api.spotify.com/v1/search?type=artist&q=bonobo"
uri = URI(url)
request = Net::HTTP::Get.new(uri)
request["MyCustomHeader"] = "abcde"
@madhikarma
madhikarma / gist:3cda4b641a83071a7d008021f5bdb97e
Created January 17, 2017 18:07
Hockey app upload script
# dSYMs
# part 1
ZIPPED_DSYM="${BUILD_FILE_NAME}.dSYM.zip"
cd "${BUILD_FILE_NAME}.xcarchive/"
zip -r "../$ZIPPED_DSYM" "dSYMs/"
cd ..
# Deploy
@madhikarma
madhikarma / setup_ruby_fastlane.sh
Created December 28, 2016 14:44
Ruby setup for using Fastlane
brew update && brew upgrade openssl
rvm osx-ssl-certs update all
rvm reinstall ruby-2.2.3 --with-openssl-dir=/usr/local
@madhikarma
madhikarma / build.sh
Last active June 8, 2020 08:33
xcodebuild script
#!/bin/sh
set -eo pipefail
IFS=$'\n\t'
# Constants
NOW=$(date +%s)
BUILD_FILE_NAME="MyApp-${NOW}"
SCHEME="MyApp"
WORKSPACE="MyApp"
PROJECT="MyApp"
# Xcode
.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3