Skip to content

Instantly share code, notes, and snippets.

View awgeezrick's full-sized avatar

Mark Jones awgeezrick

View GitHub Profile
@mikowl
mikowl / oneliners.js
Last active September 24, 2025 19:23
👑 Awesome one-liners you might find useful while coding.
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// or
const sleep = util.promisify(setTimeout);
// Program for cloning repos at a specific place on your computer
package main
import (
"flag"
"fmt"
"net/url"
"os"
"os/exec"
"path/filepath"
@knu2xs
knu2xs / get_dataframe.py
Last active June 28, 2023 11:46
Automatically cast a variety of inputs by introspectively detecting the data type and converting to a Spatially Enabled Dataframe
from arcgis.features import GeoAccessor, FeatureLayer
from arcgis.geometry import Geometry
from arcgis.gis import GIS
import pandas as pd
import os
import re
def get_dataframe(in_features, gis=None):
"""
@akella
akella / setup.md
Last active June 29, 2025 16:48
My Setup
@discdiver
discdiver / jupyterlab_shortcuts.md
Last active November 5, 2025 16:16
Common Jupyter Lab Keyboard Shortcuts

If you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).

Shortcuts when in either command mode (outside the cells) or edit mode (inside a cell):

  • Shift + Enter run selected cell or cells - if no cells below, insert a code cell below

  • Ctrl + B toggle hide/show left sidebar

  • Ctrl + S save and checkpoint

  • Ctrl + Shift + S save as

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import pandas as pd
if __name__ == '__main__':
# Override default pandas configuration
pd.options.display.width = 0
pd.options.display.max_rows = 10000
pd.options.display.max_info_columns = 10000
# Open example data.
df = pd.read_csv('employee_data.csv')
@MineRobber9000
MineRobber9000 / donotuse3.py
Last active February 8, 2024 12:48
How to NEVER use lambdas - Python 3 edition
###########################################################
# How to NEVER use lambdas. An inneficient and yet educa- #
# tonal [sic] guide to the proper misuse of the lambda #
# construct in Python 3.x. [DO NOT USE ANY OF THIS EVER] #
# original by (and apologies to): e000 (13/6/11) #
# now in Python 3 courtesy of: khuxkm (17/9/20) #
###########################################################
## Part 1. Basic LAMBDA Introduction ##
# If you're reading this, you've probably already read e000's
import os
filename = 'homework.txt'
if not os.path.exists(filename):
with open(filename, 'w'): pass
answer1 = """1).
X | 3 | X
____|____|____