Skip to content

Instantly share code, notes, and snippets.

View ronaldlangeveld's full-sized avatar

Ronald Langeveld ronaldlangeveld

View GitHub Profile
@Fanna1119
Fanna1119 / Django_ajax_file_upload.py
Last active May 26, 2021 19:47
Django Ajax File Upload with image compression
//HtML
<form>
{% csrf_token %}
<input type="file" name="pic" accept="image/*" id="image">
<input type="submit" id="send">
</form>
//JS
@levelsio
levelsio / levelsio-by.html
Last active March 10, 2021 05:20
Maker Link (aka the @levelsio by link)
<!-- Maker Link by @levelsio -->
<!-- MIT License -->
<style>
body {
background:#333;
}
.levelsio-by {
font-family:"Helvetica Neue",sans-serif;
right:0;
@keithweaver
keithweaver / Home.js
Last active September 7, 2022 07:27
Sign up/in form in React.js
import React, { Component } from 'react';
import 'whatwg-fetch';
import {
getFromStorage,
setInStorage,
} from '../../utils/storage';
class Home extends Component {
constructor(props) {
@naotokui
naotokui / surfspots.json
Last active October 4, 2024 18:08
location info of 5980 surf spots around the world
[
{
"lng" : "4.1428327560425",
"lat" : "52.01150069904",
"country" : "Netherlands",
"name" : "'s-Gravenzande"
},
{
"lng" : "3.3628463745118",
"lat" : "51.370923071145",
@sirodoht
sirodoht / migrate-django.md
Last active June 4, 2025 05:09
How to migrate Django from SQLite to PostgreSQL

How to migrate Django from SQLite to PostgreSQL

Dump existing data:

python3 manage.py dumpdata > datadump.json

Change settings.py to Postgres backend.

Make sure you can connect on PostgreSQL. Then:

@nickjevershed
nickjevershed / google-sheets-json.py
Last active July 26, 2024 10:32
Python script to convert Google spreadsheets to simple JSON file and save it locally. Assumes your data is on the left-most sheet, ie the default. Spreadsheet needs to be 'published to the web'.
import simplejson as json
import requests
#your spreadsheet key here. I'm using an example from the Victorian election campaign
key = "1THJ6MgfEk-1egiPFeDuvs4qEi02xTpz4fq9RtO7GijQ"
#google api request urls - I'm doing the first one just to get nice key values (there's probably a better way to do this)
url1 = "https://spreadsheets.google.com/feeds/cells/" + key + "/od6/public/values?alt=json"