Skip to content

Instantly share code, notes, and snippets.

View itsjoekent's full-sized avatar
🚂
🚋 🚋 🚋

Joe Kent itsjoekent

🚂
🚋 🚋 🚋
View GitHub Profile
@cassidoo
cassidoo / useMedia.jsx
Last active October 27, 2022 16:13
An example of checking on a media query with React Hooks
function useMedia(query) {
const [matches, setMatches] = useState(window.matchMedia(query).matches)
useEffect(() => {
const media = window.matchMedia(query)
if (media.matches !== matches) {
setMatches(media.matches)
}
const listener = () => {
setMatches(media.matches)
import requests
req = {'limit' : 100,
'start_time': '2012-06-12T010:30-5:00',
'include_profile' : 'false',
'end_time': '2014-06-13T10:30-5:00',
'page': PAGE_NUM}
r=requests.get(r'https://secure.mcommons.com/api/messages',auth=('USERNAME','PASSWORD'),data=req)
print r.text
@paulkaplan
paulkaplan / STLFileSaver.js
Last active September 14, 2020 13:44
Create an ASCII STL file from a THREE.js mesh that can be saved save from browser and 3D printed
/*
Paul Kaplan, @ifitdidntwork
Create an ASCII STL file from a THREE.js mesh
that can be saved save from browser and 3D printed
--------------------------------------------------
See further explanation here:
http://buildaweso.me/project/2013/2/25/converting-threejs-objects-to-stl-files
--------------------------------------------------
Saving the file out of the browser is done using FileSaver.js
@hay
hay / gist:1351230
Last active December 4, 2024 08:11
Enterprisify your Java Class Names!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Enterprisify your Java Class Names! (by Hay Kranen)</title>
<style>
body {
background: white;
text-align: center;