Skip to content

Instantly share code, notes, and snippets.

View AloyASen's full-sized avatar
💭
working remotely

Aloy Aditya Sen AloyASen

💭
working remotely
View GitHub Profile
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active June 2, 2024 12:46
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@deathcap
deathcap / ls.js
Last active August 25, 2022 18:11
example of transpiling FreeBSD bin/ls/ls.c to JS using https://github.com/deathcap/transpile-c-to-js
function xo_emit_hvp(xop, fmt, vap)
{
return xo_emit_hv(xop, fmt, vap);
}
function xo_emit_hp(xop, fmt, ...args)
{
let vap;
__builtin_va_start(vap);
let rc = xo_emit_hv(xop, fmt, vap);
@Smerity
Smerity / fetch_page.py
Created August 7, 2015 21:30
An example of fetching a page from Common Crawl using the Common Crawl Index
import gzip
import json
import requests
try:
from cStringIO import StringIO
except:
from StringIO import StringIO
# Let's fetch the Common Crawl FAQ using the CC index
resp = requests.get('http://index.commoncrawl.org/CC-MAIN-2015-27-index?url=http%3A%2F%2Fcommoncrawl.org%2Ffaqs%2F&output=json')
@staltz
staltz / introrx.md
Last active June 2, 2024 11:03
The introduction to Reactive Programming you've been missing
@TooTallNate
TooTallNate / ffi_closure_alloc_test.c
Created January 7, 2012 20:12
The example from the libffi docs for how to use `ffi_closure` with `ffi_closure_alloc()` and `ffi_closure_free()`.
#include <stdio.h>
#include <ffi.h>
/* Acts like puts with the file given at time of enclosure. */
void puts_binding(ffi_cif *cif, unsigned int *ret, void* args[],
FILE *stream)
{
*ret = fputs(*(char **)args[0], stream);
}
<!--
-->
<html>
<head>
<title>WebGL Demo</title>
<meta charset="utf-8">
<script src="./js/build/Three.js" type="text/javascript"></script>
<script src="./js/js/RequestAnimationFrame.js" type="text/javascript"></script>
<script src="./js/js/Stats.js" type="text/javascript"></script>