Skip to content

Instantly share code, notes, and snippets.

View jason2506's full-sized avatar
🔰

Chi-En Wu jason2506

🔰
View GitHub Profile
@mmrko
mmrko / mocha-react-css-modules.js
Last active January 1, 2024 00:15
Mocha & React & CSS Modules with Sass
// setup.js
import hook from 'css-modules-require-hook'
import sass from 'node-sass'
hook({
extensions: [ '.scss' ],
preprocessCss: data => sass.renderSync({ data }).css
})

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@apit
apit / get-ted.py
Created September 6, 2011 05:28
TED video/subtitle/comments downloader
#! /usr/bin/python -u
"""
@author apit - http://fizdoonk.multiply.com/
@require python-lxml, python-simplejson
"""
import os, sys, re, codecs
import simplejson
import urllib2