Skip to content

Instantly share code, notes, and snippets.

View xihajun's full-sized avatar
🐢
I may be slowwww to respond.

xihajun xihajun

🐢
I may be slowwww to respond.
View GitHub Profile
@radames
radames / README.md
Last active March 4, 2024 06:44
How to connect to your Google Colab Notebook via SSH!

Connect to your Google Colab Notebook via SSH

Using this amazing project tmate.io you can SSH tunnel to your colab notebook machine. You can with few lines of code download the binary, run an instance in the background and output the generated SSH address.

!wget -nc https://github.com/tmate-io/tmate/releases/download/2.4.0/tmate-2.4.0-static-linux-i386.tar.xz &> /dev/null
!tar --skip-old-files -xvf tmate-2.4.0-static-linux-i386.tar.xz &> /dev/null
!rm -f nohup.out; bash -ic 'nohup ./tmate-2.4.0-static-linux-i386/tmate -S /tmp/tmate.sock new-session -d & disown -a' >/dev/null 2>&1
!./tmate-2.4.0-static-linux-i386/tmate -S /tmp/tmate.sock wait tmate-ready
@theorm
theorm / Dockerfile
Last active August 9, 2022 16:34
Serve a fairseq summary model as an API
FROM python:3.6.6-slim
WORKDIR /fia
RUN apt-get update
# the big one
RUN pip install torch
RUN apt-get install -y --no-install-recommends build-essential wget
@Iridium-IO
Iridium-IO / README.md
Last active January 30, 2024 10:36
Collapsible Markdown Code Blocks

Example Collapsible Content

Style 1

Click to see more:
Given the following python code
from pychartjs import BaseChart

class myChart(BaseChart):
@joshdavenport
joshdavenport / a-gallery.md
Created January 13, 2018 12:04
Basic reusable jekyll gallery utilising variable
import org.tensorflow.contrib.android.TensorFlowInferenceInterface;
/** One time initialization: */
TensorFlowInferenceInterface tensorflow = new TensorFlowInferenceInterface(getAssets(), "file:///android_asset/model.pb");
/** Continuous inference (floats used in example, can be any primitive): */
// loading new input
tensorflow.feed("input:0", input, INPUT_SHAPE); // INPUT_SHAPE is an long[] of expected shape, input is a float[] with the input data
@laserson
laserson / README.md
Created September 28, 2017 18:51
Transfer mail from Outlook for Mac to Gmail

Drag and drop desired messages to directories (e.g., archived/).

Convert directory to mbox file

./eml2mbox.py archived archived.mbox

Follow directions here to upload via Gmail API

https://github.com/google/import-mailbox-to-gmail
@nicolewhite
nicolewhite / northwind.markdown
Last active January 25, 2023 07:55
MySQL to Neo4j

From SQL to Neo4j: Northwind

SQL Model

Neo4j Model

Get the SQL Dump

The SQL dump was stolen from here and imported into MySQL.

@developius
developius / README.md
Last active April 25, 2024 22:15
Setup SSH keys for use with GitHub/GitLab/BitBucket etc

Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings (https://github.com/settings/keys).

Test SSH key:

@leoken
leoken / wp-loop-images.php
Created October 13, 2012 06:11
Create A Loop Of Images
function catch_that_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a default image
$first_img = "/images/default.jpg";
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 29, 2024 08:12
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname