Skip to content

Instantly share code, notes, and snippets.

View gdlmx's full-sized avatar

Mingxuan Lin gdlmx

View GitHub Profile
import { cx, css } from 'emotion';
const button = {
background: black,
color: white,
'& + &': {
marginLeft: '8px',
}
};
const buttonPrimary = {
background: red,
@lukas-koschmieder
lukas-koschmieder / condor-8.6.11-py3.patch
Last active June 5, 2018 19:14
HTCondor 8.6.11 Python 3 patch
diff -r -u a/src/python-bindings/classad_python_user.cpp b/src/python-bindings/classad_python_user.cpp
--- a/src/python-bindings/classad_python_user.cpp
+++ b/src/python-bindings/classad_python_user.cpp
@@ -48,7 +48,7 @@
{
if (!Py_IsInitialized())
{
- char pname[] = "htcondor";
+ wchar_t pname[] = L"htcondor";
Py_SetProgramName(pname);
@wd15
wd15 / README.md
Last active November 22, 2023 02:24
Implementation of benchmark 3

Implementation of Benchmark 3

Linting and testing

$ pylint *.py
$ flake8 *.py

TODO

  • generate upload files from view.py
@cyberang3l
cyberang3l / How to setup VirtualGL and TurboVNC on Ubuntu.md
Last active April 6, 2025 04:07
Setup VirtualGL and TurboVNC on Ubuntu for OpenGL forwarding
@SKempin
SKempin / Git Subtree basics.md
Last active April 27, 2025 18:43
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@rejunity
rejunity / recipe_for_Unity_offscreen.sh
Last active October 30, 2024 07:29
How to run Unity standalone application "offscreen" on Linux
# Recipe on running Unity (or any OpenGL based application) offscreen on your local Linux machine.
# Requirement: X server, NVIDIA drivers installed and working correctly.
# Tested on Ubuntu14.04.
# Summary: install XDummy and VirtualGL, configure virtual framebuffer, run your application via VirtualGL
# install XDummy
sudo apt-get update
sudo apt-get install xorg-video-abi-15 xserver-xorg-video-dummy
@epixoip
epixoip / 8x1080.md
Last active November 3, 2024 15:42
8x Nvidia GTX 1080 Hashcat Benchmarks
@jgwerner
jgwerner / install.sh
Last active October 9, 2017 14:06
Clean setup for JupyterHub demo
# Installs new JupyterHub with Ubuntu 14.04 (Trusty) on host
# with self signed SSL certificate. Change SSL section
# to incorporate procedure for signing with trusted CA.
#!/bin/bash
# make install dir
mkdir /home/ubuntu/install-host
# set environment vars
@garaud
garaud / sqlalchemy-orm-query-to-dataframe.py
Last active June 7, 2024 13:55
Example to turn your SQLAlchemy Query result object to a pandas DataFrame
# -*- coding: utf-8 -*-
"""From a Query.all(), turn this result to a pandas DataFrame
Table creation and example data come from the official SQLAlchemy ORM
tutorial at http://docs.sqlalchemy.org/en/latest/orm/tutorial.html
Just take a look at the 'query_to_dict' function and the last part of the __main__.
"""
@melvincabatuan
melvincabatuan / BOOSTwithPython3
Created April 5, 2015 10:47
Compile BOOST with Python3 support
1. Check Python3 root
>>> import sys
>>> import os
>>> sys.executable
'/usr/local/bin/python3'
OR
$ which python3
/usr/local/bin/python3