Skip to content

Instantly share code, notes, and snippets.

View chtlp's full-sized avatar

Linpeng Tang chtlp

View GitHub Profile
@ma7dev
ma7dev / README.md
Last active March 25, 2023 21:43
Streamlit + Flask example

A simple example for Streamlit and Flask project

  • server.py contains the API code for the Flask server (back-end)
  • main.py contains the streamlit code (front-end)

Requirements

pip install plotly streamlit pandas requests flask
@diegopacheco
diegopacheco / bazel-ubuntu-20.04.md
Created December 4, 2020 17:41
Installing Google Bazel on Ubuntu 20.04 LTS
sudo apt install curl gnupg
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list

sudo apt update && sudo apt install bazel
sudo apt update && sudo apt full-upgrade
bazel --version
@ilanKeshet
ilanKeshet / git-mv-with-history
Last active January 3, 2023 16:37 — forked from emiller/git-mv-with-history
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# credit: foked from https://gist.github.com/emiller/6769886 emiller/git-mv-with-history
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
@emiller
emiller / git-mv-with-history
Last active April 17, 2024 21:06
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@amitmurthy
amitmurthy / mapshmem.jl
Last active December 16, 2015 18:28
shmem and mmap
using Base.FS
# Below constants are vaid for Ubuntu. May be different for OSX
const PROT_READ = 0x01
const PROT_WRITE = 0x02
const MAP_SHARED = 0x01
type ShmemVar
v_name::Symbol
v_type::Type
@kizzx2
kizzx2 / fun.cpp
Created January 11, 2012 14:29
Illustrative C++ Lua binding example/tutorial
// fun.cpp
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <iostream>
@arnolddevos
arnolddevos / gist:574873
Created September 11, 2010 05:36
Idea for generator and suspendable wrapper
import scala.util.continuations._
class Generator[A] extends Iterator[A] with (A => Unit @ suspendable) {
private var a: Option[A] = None
private var k: Option[Unit => Unit] = None
def next = {
val a0 = a.get
val k0 = k.get
a = None