Skip to content

Instantly share code, notes, and snippets.

View JavaCS3's full-sized avatar
๐Ÿ˜‘
Working

Charles Wei JavaCS3

๐Ÿ˜‘
Working
View GitHub Profile
@JavaCS3
JavaCS3 / logging_subprocess.py
Created September 11, 2016 11:02 — forked from bgreenlee/logging_subprocess.py
Variant of subprocess.call that accepts a logger instead of stdout/stderr #python
import subprocess
import select
from logging import DEBUG, ERROR
def call(popenargs, logger, stdout_log_level=DEBUG, stderr_log_level=ERROR, **kwargs):
"""
Variant of subprocess.call that accepts a logger instead of stdout/stderr,
and logs stdout messages via logger.debug and stderr messages via
logger.error.
@JavaCS3
JavaCS3 / gist:42abac5311eca82f0b5bc2f1a99ddb97
Created October 5, 2016 04:20
ไธŠๆตท่ก—้“ๅ็งฐๅˆ—่กจ
้ป„ๆตฆๅŒบ
่ก—้“ ๅ—ไบฌไธœ่ทฏ่ก—้“ ๅค–ๆปฉ่ก—้“ ๅŠๆทžๅ›ญ่ทฏ่ก—้“ ๅฐไธœ้—จ่ก—้“ ่ฑซๅ›ญ่ก—้“ ่€่ฅฟ้—จ่ก—้“
ๅขๆนพๅŒบ
่ก—้“ ไบ”้‡Œๆกฅ่ก—้“ ๆ‰“ๆตฆๆกฅ่ก—้“ ๆทฎๆตทไธญ่ทฏ่ก—้“ ็‘ž้‡‘ไบŒ่ทฏ่ก—้“
ๅพๆฑ‡ๅŒบ
่ก—้“ ๅคฉๅนณ่ทฏ่ก—้“ ๆน–ๅ—่ทฏ่ก—้“ ๆ–œๅœŸ่ทฏ่ก—้“ ๆžซๆž—่ทฏ่ก—้“ ้•ฟๆกฅ่ก—้“ ็”ฐๆž—่ก—้“ ่™นๆข…่ทฏ่ก—้“ ๅบทๅฅๆ–ฐๆ‘่ก—้“ ๅพๅฎถๆฑ‡่ก—้“ ๅ‡Œไบ‘่ทฏ่ก—้“ ้พ™ๅŽ่ก—้“ ๆผ•ๆฒณๆณพ่ก—้“
้•‡ ๅŽๆณพ้•‡
็ฑปไผผไนก็บงๅ•ไฝ ๆผ•ๆฒณๆณพๆ–ฐๅ…ดๆŠ€ๆœฏๅผ€ๅ‘ๅŒบ
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude ([email protected])
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///
import QtQuick 2.4
Image {
property color color
property int top_left_radius
property int top_right_radius
property int bottom_left_radius
property int bottom_right_radius
Vue.component('vue-chart', {
template: '<canvas></canvas>',
props: {
type: {
type: String,
default: 'line'
},
data: {
type: Object,
default: function _default() {
@JavaCS3
JavaCS3 / index.html
Created September 13, 2017 10:03 — forked from orbitbot/index.html
Ace editor with http-link highlighting and click action, from http://jsbin.com/jehopaja/30/edit?html,output
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="http://ajaxorg.github.io/ace-builds/src/ace.js"></script>
<style>
#editor { position: absolute; top: 0; left: 0; right: 0; bottom: 0;}
.ace_link_marker {
position: absolute;
@JavaCS3
JavaCS3 / submodule-helper.py
Created February 18, 2019 02:46
Update submodule revision recursively in case you have nested submodule
#!/usr/bin/env python
# Style Guide: https://github.com/google/styleguide/blob/gh-pages/pyguide.md
# Pythonic: https://docs.python-guide.org/writing/style/
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
@JavaCS3
JavaCS3 / utils.py
Created February 18, 2019 03:03
Python color print and shell utils scripts
# Style Guide: https://github.com/google/styleguide/blob/gh-pages/pyguide.md
# Pythonic: https://docs.python-guide.org/writing/style/
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import string
@JavaCS3
JavaCS3 / quizz.md
Last active April 11, 2019 14:43
Interview Quizz

Interview Quizz: Cashier

A cashier in a shop need a program that will print out a receipt for a given order. And you're going to implement that.

Q1: Simple Printing

We're going to use some objects interaction to represent a payment process, and then print a receipt.

# python version
@JavaCS3
JavaCS3 / readme.md
Last active June 20, 2019 09:39
How to setup ssh proxy

How to setup ssh proxy

Add the following in your ~/.ssh/config

Host <dest domain/ip>
  ProxyCommand ssh -q -W %h:%p <proxy user>@<proxy domain/ip>

Example