Skip to content

Instantly share code, notes, and snippets.

@kuoe0
kuoe0 / divisible-by-3-string.py
Created December 14, 2013 12:33
check integer divisible by 3 using string conversion
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
@kuoe0
kuoe0 / divisible-by-3-division.py
Created December 14, 2013 12:32
check integer is divisible by 3 using division operation
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2013 KuoE0 <kuoe0.tw@gmail.com>
#
# Distributed under terms of the MIT license.
"""
@kuoe0
kuoe0 / color_code.sh
Last active September 11, 2018 09:36
generate all combination of control code
#!/bin/bash
TEXT=" text "
RESET="\x1b[0m"
echo -n ' '
for i in `seq 0 7`; do
echo -n " 4${i}m "
done
@kuoe0
kuoe0 / EFI_Snake.c
Created September 28, 2013 08:33
http://bbs.csdn.net/topics/320147085 在 EFI 下完貪食蛇...
#include "efi.h"
#include "efilib.h"
#include "she.h"
#include <atk_libc.h>
#include <stdio.h>
#include <stdlib.h>
#include "Bmp.h"
#include "Hii.h"
#!/usr/bin/env sbcl --script
;;; load quicklisp
(load "~/.quicklisp/setup.lisp")
;;; load package and redirect the loading msg to /dev/null
(with-open-file (*standard-output* "/dev/null" :direction
:output :if-exists :supersede)
(ql:quickload '("drakma" "com.informatimago.common-lisp.html-parser")))
;;; get html tag name
(defun html-tag (xml)
@kuoe0
kuoe0 / Install_OpenSSL_APT.sh
Created September 23, 2013 18:18
編譯採用 OpenSSL 的 APT,避免某些網路環境下發生 gnutls_handshake() failed 的情況!
#!/usr/bin/env bash
# =============================================================================
# FileName: Install_OpenSSL_APT.sh
# Desc: Build APT with OpenSSL and Install it
# Environment: Ubuntu 13.04 amd64
# Usage: ./Install_OpenSSL_APT.sh
# Author: KuoE0 <kuoe0.tw@gmail.com>
# HomePage: http://kuoe0.tw/
# Copyright: BSD License (C) 2013 KuoE0
# =============================================================================
@kuoe0
kuoe0 / Install_OpenSSL_GIT.sh
Last active September 24, 2018 10:29
編譯採用 OpenSSL 的 git,避免某些網路環境下發生 gnutls_handshake() failed 的情況!
#!/usr/bin/env bash
# =============================================================================
# FileName: Install_OpenSSL_GIT.sh
# Desc: Build GIT with OpenSSL and Install it
# Environment: Ubuntu 13.04 amd64
# Usage: ./Install_OpenSSL_GIT.sh
# Author: KuoE0 <kuoe0.tw@gmail.com>
# HomePage: http://kuoe0.tw/
# Copyright: BSD License (C) 2013 KuoE0
# =============================================================================
<script type="text/javascript">
var interval = 25;
var myTimer;
var isTick = false;
var h = getDocHeight() * 0.6;
//console.log(h);
var count = 0;
# Put in const.py...:
class _const:
class ConstError(TypeError): pass
def __setattr__(self,name,value):
if self.__dict__.has_key(name):
raise self.ConstError, "Can't rebind const(%s)"%name
self.__dict__[name]=value
import sys
sys.modules[__name__]=_const()
#!/usr/bin/env bash
# =============================================================================
# FileName: Install_OpenSSL_PyCurl.sh
# Desc: Build PyCurl with OpenSSL and Install it
# Environment: Ubuntu 13.04 amd64
# Usage: ./Install_OpenSSL_PyCurl.sh
# Author: KuoE0 <kuoe0.tw@gmail.com>
# HomePage: http://kuoe0.tw/
# Copyright: BSD License (C) 2013 KuoE0
# =============================================================================