Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
👋

Josh Santangelo endquote

💭
👋
View GitHub Profile
View esm-package.md

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@vadimdemedes
vadimdemedes / app.js
Last active Jul 10, 2020
Starter code for creating a custom React renderer
View app.js
import React from 'react';
import reconciler from './reconciler';
const App = () => {
return <h1>Hello World</h1>;
};
const render = (tree, target) => {
const container = reconciler.createContainer(target);
container.updateContainer(tree, container);
@JonnyWong16
JonnyWong16 / sync_playlists_to_users.py
Last active Dec 1, 2021
Sync Plex playlists to shared users.
View sync_playlists_to_users.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Description: Sync Plex playlists to shared users.
# Author: /u/SwiftPanda16
# Requires: plexapi, requests, xmltodict
import requests
import xmltodict
View nodejs setup on Dreamhost VPS
1) Make a download dir to store the node source and download it.
mkdir downloads
cd downloads
git clone https://github.com/joyent/node.git
Find the latest version
2) List all of the tags in the repository, and check out the most recent.
git tag
git checkout v0.9.9
@endquote
endquote / instagram.js
Last active Dec 11, 2015
Keyboard navigation for Instagram timeline
View instagram.js
/*
A userscript to add keyboard shortcuts to the Instagram timeline:
- J or space to go to next image
- K to go to previous image
- L to toggle like on the current image
- N to load new posts
*/
$(document.body).keypress(function(event) {
// ignore keypresses in comment fields
@will3942
will3942 / app.rb
Last active Sep 15, 2021
Reverse-Engineering Instagram
View app.rb
require 'openssl'
require 'base64'
require 'json'
require 'httpclient'
http = HTTPClient.new(:agent_name => useragent)
key = "" #The Private key
login_info = {:guid => "00000000-0000-0000-0000-000000000000",
:password => "PASSWORD",
:username => "USERNAME",
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active Dec 2, 2021
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
View osx-for-hackers.sh
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@jamiew
jamiew / google_twunter_lol
Created Jul 28, 2011
All the dirty words from Google's "what do you love" project: http://www.wdyl.com/
View google_twunter_lol
easterEgg.BadWorder.list={
"4r5e":1,
"5h1t":1,
"5hit":1,
a55:1,
anal:1,
anus:1,
ar5e:1,
arrse:1,
arse:1,