This is content converted from Markdown!
<script src="https://gist.github.com/HaiNguyen007/2b9d0f723bb02f97252ea5ae697c3249.js"></script>Here's a JSON sample:
{| # first: mkdir user && cd user && cp /path/to/get_gists.py . | |
| # python3 get_gists.py user | |
| import requests | |
| import sys | |
| from subprocess import call | |
| user = sys.argv[1] | |
| r = requests.get('https://api.github.com/users/{0}/gists'.format(user)) |
| """Download all gists for a specific user in a local directory using git. | |
| Make a directory for a <user> and copy this file there before running. | |
| mkdir <user> | |
| cd <user> | |
| curl https://gist.githubusercontent.com/epogrebnyak/c14d6d2ca2740d1e1018e701ea00472a/raw/ec44560c8fd8fb92ca81bafa48b0a08272138104/get_gists.py > get_gists.py | |
| python3 get_gists.py user | |
| """ | |
This is content converted from Markdown!
<script src="https://gist.github.com/HaiNguyen007/2b9d0f723bb02f97252ea5ae697c3249.js"></script>Here's a JSON sample:
{| # Edit the clipboard in your $EDITOR | |
| # Add this to your `.bashrc` file | |
| function pbedit () { | |
| local tmpfile=`mktemp` | |
| pbpaste > $tmpfile | |
| $EDITOR $tmpfile | |
| pbcopy < $tmpfile | |
| rm -f $tmpmfile | |
| } | |
| export -f pbedit |
| const puppeteer = require('puppeteer'); | |
| const cheerio = require('cheerio'); | |
| async function run() { | |
| const browser = await puppeteer.launch(); | |
| const page = await browser.newPage(); | |
| await page.goto('https://news.ycombinator.com'); | |
| let content = await page.content(); | |
| var $ = cheerio.load(content); |
| ; A REPL-based, annotated Seesaw tutorial | |
| ; Please visit https://github.com/daveray/seesaw for more info | |
| ; | |
| ; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers | |
| ; Seesaw's basic features and philosophy, but only scratches the surface | |
| ; of what's available. It only assumes knowledge of Clojure. No Swing or | |
| ; Java experience is needed. | |
| ; | |
| ; This material was first presented in a talk at @CraftsmanGuild in | |
| ; Ann Arbor, MI. |
| ;; | |
| ;; NS CHEATSHEET | |
| ;; | |
| ;; * :require makes functions available with a namespace prefix | |
| ;; and optionally can refer functions to the current ns. | |
| ;; | |
| ;; * :import refers Java classes to the current namespace. | |
| ;; | |
| ;; * :refer-clojure affects availability of built-in (clojure.core) | |
| ;; functions. |
| (use 'clojure.pprint) | |
| (import 'java.lang.Thread) | |
| (-> (Thread/currentThread) (.getContextClassLoader) (.getURLs) (seq) (pprint)) |
| (println (clojure.string/join "\n" (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))))) |
| //Version 2.6 | |
| (function () { | |
| function eOPML(str) { | |
| return str | |
| .replace(/&/g, '&amp;') | |
| .replace(/</g, '&lt;') | |
| .replace(/>/g, '&gt;') | |
| .replace(/"/g, '"') | |
| .replace(/(\n)/g, ' '); | |
| } |