Skip to content

Instantly share code, notes, and snippets.

View ourway's full-sized avatar
🏆

Farshid Ashouri ourway

🏆
View GitHub Profile
@ourway
ourway / dictionary.py
Created December 27, 2015 13:10
Dictionary implementation in pure Python
"""
A Python dict implementation.
"""
import collections
MINSIZE = 8
PERTURB_SHIFT = 5
dummy = "<dummy key>"
@ourway
ourway / polyalphabetic-cipher.py
Created March 28, 2015 21:05
poly-alphabetic cipher implementation in Python
""" This programme implements a polyalphabetic cipher. """
import string
ALPHABET = string.ascii_lowercase
CHARACTERS_THAT_MUST_REMAIN_THE_SAME = string.digits + string.punctuation + string.whitespace
def cycle_get(lst,index):
"""
from selenium.common.exceptions import NoSuchElementException, ElementClickInterceptedException
from selenium import webdriver
import time
import pandas as pd
def get_jobs(keyword, num_jobs, verbose):
'''Gathers jobs as a dataframe, scraped from Glassdoor'''
# Initializing the webdriver
@ourway
ourway / pandas cheat sheet.md
Created April 20, 2023 16:09 — forked from fabsta/pandas cheat sheet.md
pandas cheat sheet

[TOC]

Preliminaries/Import

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pandas import DataFrame, Series
" Helps force plugins to load correctly when it is turned back on below
filetype off
" Install vim plug if not installed
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Helps force plugins to load correctly when it is turned back on below
filetype off
" Install vim plug if not installed
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
defmodule GFLOPS do
def calculate do
num_iterations = 1_000_000_000
start_time = :erlang.monotonic_time()
for _ <- 1..num_iterations do
# Perform a double-precision floating point operation
_ = 1.0 + 1.0
end
end_time = :erlang.monotonic_time()
set editing-mode vi
# vi settings
$if mode=vi
set keymap vi-insert
"kj" # remap escape
$endif
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@ourway
ourway / lua_cheat_sheet.lua
Created November 19, 2018 02:15
Lua programming language cheat sheet
print("Hello World")
--[[
Multiline comment
]]
-- Variable names can't start with a number, but can contain letters, numbers
-- and underscores
-- Lua is dynamically typed based off of the data stored there