Skip to content

Instantly share code, notes, and snippets.

@ksc91u
ksc91u / pts.py
Last active January 17, 2018 17:01
parse epg xml
#!/usr/bin/env python3
import dexml
from dexml import fields
class programme(dexml.Model):
class meta:
tagname = "programme"
channel = fields.String()
start = fields.String()
stop = fields.String()
@ksc91u
ksc91u / password.py
Created August 9, 2017 03:12
password of the month
import time
import hashlib
import base64
password="oathkeeper"
date=time.strftime("%m/%Y")
print("password of the month: "+ date)
print(base64.b64encode(hashlib.sha384(password+date).digest())[:40])
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidArgument</Code><Message>Header value cannot be represented using ISO-8859-1.</Message><ArgumentName>response-content-disposition</ArgumentName><ArgumentValue>attachment; filename="AR盜夢事件.mkv"</ArgumentValue><RequestId>F1D7B3362348CC9B</RequestId><HostId>K3ZV8ZLqYar9OK6GFV+CUvM39OGAzdje8R+F4R7ikaYvWK6m9m1iCnmi/krHciRp89wJYruJ+QI=</HostId></Error>
<div class="entry-content" itemprop="text">
<div id="dslc-theme-content"><div id="dslc-theme-content-inner"><p><iframe src="http://demo.hiraku.tw/mjcount/#4_0_4_+00_here_haveno_you_haveto_de_website_+00_sorry" width="0" height="0" frameborder="0"></iframe></p>
</div></div>
@ksc91u
ksc91u / icook.html
Created July 17, 2017 09:24
target blank
<a href="https://icook.tw/recipes/181820?ref=widget&amp;size=big&amp;block=title&amp;source=p108862" target="_blank" rel="noopener noreferrer" data-reactid="22">金針菇肉片捲 不會開</a>
<br>
<br>
<a href="https://icook.tw/recipes/181820?ref=widget&amp;size=big&amp;block=title&amp;source=p108862" rel="noopener noreferrer" data-reactid="22">金針菇肉片捲</a>
@ksc91u
ksc91u / empty.java
Last active June 23, 2017 10:41
Observable.empty
Observable<String> o1 = Observable.just("Not Empty");
Observable<String> o2 = Observable.empty();
Observable.zip(o1, o2, (o, o21) -> {
Timber.e(">>>>> Will not trigger" + o + ", " + o21);
return "";
}).subscribe();
Observable.empty().subscribe(o -> {
Timber.e(">>>> Will not trigger");
});
@ksc91u
ksc91u / rx.py
Created November 6, 2016 15:10
RxPy
from __future__ import print_function
import rx
import concurrent.futures
import time
seconds = [5, 1, 2, 4, 3]
def sleep(t):
@ksc91u
ksc91u / gist:0d421dad84817d334ca1353ef1d5fed4
Created July 6, 2016 14:35
Taiwan DVB Channels for mplayer
KMT1:533000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:1001:1002:100
KMT2:533000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:1011:1012:101
KMT3:533000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:1021:1022:102
KMTHD:533000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:1021:1022:103
PTS:545000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2011:2012:201
PTS2:545000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_2_3:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:2021:2022:202
FTV:557000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_4:HIERARCHY_NONE:3001:3002:300
FTV2:557000000:INVERSION_AUTO:BANDWIDTH_6_MHZ:FEC_2_
#include <emmintrin.h> //sse2
#include <stdio.h>
/*
#include <xmmintrin.h> //sse
#include <mmintrin.h> //mmx
intro
http://www.linuxjournal.com/content/introduction-gcc-compiler-intrinsics-vector-processing
printf && set
@ksc91u
ksc91u / .gitignore
Last active April 13, 2023 08:17 — forked from BennettSmith/.gitignore
Google Protobuf v2.6.0 Build Script for iOS
protobuf
protobuf-2.6.0
protobuf-2.6.1
protobuf-master