Skip to content

Instantly share code, notes, and snippets.

View Subangkar's full-sized avatar
☺️
Beauty in the Chaos

Subangkar Karmaker Shanto Subangkar

☺️
Beauty in the Chaos
View GitHub Profile
@vanessaaleung
vanessaaleung / main.c
Last active September 28, 2019 18:50
main
//
// main.c
// Created by Vanessa on 2019/4/8.
// Copyright © 2019 Vanessa JC Liang. All rights reserved.
//
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@defrex
defrex / pretty_request.py
Last active September 8, 2023 14:33
A simple function to print a Django request the way requests are meant to be printed.
def pretty_request(request):
headers = ''
for header, value in request.META.items():
if not header.startswith('HTTP'):
continue
header = '-'.join([h.capitalize() for h in header[5:].lower().split('_')])
headers += '{}: {}\n'.format(header, value)
return (
@ssstonebraker
ssstonebraker / sed cheatsheet
Created August 2, 2013 14:06 — forked from un33k/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'