Skip to content

Instantly share code, notes, and snippets.

@Manibharthi
Manibharthi / exception handling.py
Created Jun 26, 2020
exception handling (bypass error)
View exception handling.py
#exception handling
#factorial example
import math
num=int(input('enter the factorial number: '))
try:
result=math.factorial(num)
print(result)
except:
print('enter the positive integer')
@goodfr
goodfr / tidy_eval_groupby_count.R
Created Jun 26, 2020
R tidy evaluation with group by and count
View tidy_eval_groupby_count.R
# --- Tidy evaluation for dplyr group_by and count over quosure and symbols ---
set.seed(456)
tt <- tibble::tibble(gender = sample(c("Female", "Male"), 100, TRUE),
churn = sample(c("Yes", "No"), 100, TRUE)
)
tt %>%
group_by(gender) %>%
View statictest.nim
import
macros, strutils, times, sets
include "system/inclrtl"
when declared(stdout):
import os
when not defined(ECMAScript):
import terminal
View Elona-ADDT-Grammar.md
View self-signed-certificate-with-custom-ca.md

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@fgshun
fgshun / eratosthenes.py
Created Jun 26, 2020
Sieve of Eratosthenes
View eratosthenes.py
from typing import List
def eratosthenes(n: int) -> List[int]:
L = [True] * n
for i in range(2, int(n ** 0.5) + 1):
if L[i]:
for j in range(i * 2, n, i):
L[j] = False
View PY0101EN-4-1-ReadFile.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Python First.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@showerst
showerst / screenshot.sh
Created Jun 26, 2020
Script to take a screenshot on pop_os and push it to dropbox
View screenshot.sh
#!/bin/bash
# Take a screenshot of an area of the screen, upload it to dropbox and put the url into the clipboard
# Put file in any directory under your dropbox
# If it is subfolder, than you need to make them manually
FILENAME=~/Dropbox/Screenshots/Screenshot_`date +%Y-%m-%d-%H:%M`.png
# Select an area and save the screenshot
# you need to instal gnome-screenshot
You can’t perform that action at this time.