Skip to content

Instantly share code, notes, and snippets.

View goforgold's full-sized avatar
🐔
We don't need to eat anyone who would run, swim, or fly away if he could

Shashwat goforgold

🐔
We don't need to eat anyone who would run, swim, or fly away if he could
View GitHub Profile
@goforgold
goforgold / code.cs
Created May 23, 2021 09:36
Generate Insert and Update Query Using Entity (snake_case)
private static List<(string name, string paramName, object value)> GenerateNameValuePair(object obj, params string[] ignoredProperties)
{
List<(string name, string paramName, object value)> pairs = new List<(string name, string paramName, object value)>();
var props = obj.GetType().GetProperties();
foreach (var prop in props)
{
if (!IsPrimitiveType(prop.PropertyType) || ignoredProperties.Contains(prop.Name)) continue;
@goforgold
goforgold / pip
Created February 12, 2019 08:03
Current PIP LIbraries
alembic==0.8.10
amqp==2.4.1
apache-airflow==1.10.2
asn1crypto==0.24.0
Babel==2.6.0
bcrypt==3.1.6
billiard==3.5.0.5
bleach==2.1.4
boto==2.48.0
boto3==1.6.7
pipeline {
agent {
docker {
image 'goforgold/build-container:latest'
}
}
stages {
stage('Build') {
steps {
sh 'npm install'
variable "access_key" {}
variable "secret_key" {}
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "ap-south-1"
}
data "aws_ami" "node_app_ami" {
---
- hosts: all
tasks:
- name: Install the gpg key for nodejs LTS
become: true
apt_key:
url: "http://deb.nodesource.com/gpgkey/nodesource.gpg.key"
state: present
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"provisioners": [
{
"type": "shell",
"execute_command": "echo 'ubuntu' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
FROM node:8.9.4
RUN mkdir /root/packer
WORKDIR /root/packer
RUN wget https://releases.hashicorp.com/packer/1.1.3/packer_1.1.3_linux_amd64.zip
RUN wget https://releases.hashicorp.com/terraform/0.11.1/terraform_0.11.1_linux_amd64.zip
RUN apt-get update
RUN apt-get install unzip -y
RUN unzip packer_1.1.3_linux_amd64.zip
RUN unzip terraform_0.11.1_linux_amd64.zip
RUN mv packer /usr/local/bin/packer
@goforgold
goforgold / build.gradle
Last active July 24, 2017 06:27
Gradle Build Config for Creating Signed and Aligned APK
android {
signingConfigs {
release {
keyAlias 'KEY_ALIAS'
keyPassword 'KEY_PASS'
storeFile file('PATH_TO_KEY.jks')
storePassword 'STORE_PASS'
}
}
@goforgold
goforgold / bitbucket-pipelines.yml
Last active July 24, 2017 02:32
Android Bitbucket CICD Pipeline
image: uber/android-build-environment:latest
pipelines:
branches:
develop:
- step:
caches:
- gradle
script:
- mkdir "${ANDROID_HOME}/licenses" || true
@goforgold
goforgold / createmigrationscript.cmd
Created July 19, 2017 10:33
Create Migration Script (Windows Bash)
@echo off
setlocal
if /i not [%1] == [] (
set migrationname=%1
goto Begin
)
for /f "delims=" %%i in ('dotnet ef migrations list') do (
set migrationname=%%i