$ git init
$ git status
$ git add
$ git diff
$ git remote add origin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Count number of possible ways to create a sequence with following property | |
| (1 3 4) "5" (4 2) | |
| -- First part: Increasing | |
| -- Second part: decreasing | |
| ''' | |
| # no. of array items |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get update | |
| sudo apt-get install nginx | |
| sudo add-apt-repository ppa:certbot/certbot | |
| sudo apt-get update | |
| sudo apt-get install python-certbot-nginx | |
| sudo certbot --nginx -d example.com -d www.example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.*; | |
| import java.io.BufferedReader; | |
| import java.io.DataOutputStream; | |
| import java.io.InputStreamReader; | |
| import java.net.HttpURLConnection; | |
| import java.net.URL; | |
| import java.net.URLEncoder; | |
| import javax.net.ssl.HttpsURLConnection; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| import base64 | |
| kms = boto3.client('kms') | |
| keyId = kms.create_key()['KeyId'] | |
| # to encrypt data less than 4KB (usually for secret and access tokens) | |
| randomData = 'Hello world' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class BowTie { | |
| public static void main(String args[]) { | |
| int n = Integer.parseInt(args[0]); | |
| for(int i=0; i<2*n+1; i++) { | |
| for(int j=0; j<2*n+1; j++) { | |
| if ((j>i && j<2*n-i) || (j>(2*n-i) && j<i && i>n)) | |
| System.out.print(" . "); | |
| else | |
| System.out.print(" * "); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import { AppRegistry, TextInput, View,Text, StyleSheet, Switch, TouchableOpacity } from 'react-native'; | |
| export default class UselessTextInput extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| emailOpt: true, | |
| pushOpt: true | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| host = "" | |
| username = "" | |
| password = "" | |
| directory_to_export = "" | |
| database = "" | |
| all_collections = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| server_name <domain_name>.com www.<domain_name>.com; | |
| return 301 https://$server_name$request_uri; | |
| } | |
| server { | |
| listen 443 ssl; |