Skip to content

Instantly share code, notes, and snippets.

View ragnraok's full-sized avatar
🎯
Focusing

RagnarokStack ragnraok

🎯
Focusing
View GitHub Profile
#!/usr/bin/python
#-*- coding=utf-8 -*-
import requests
def checkCrt(ip):
try:
requests.get("https://%s" % ip, verify=True)
except requests.exceptions.SSLError as e:
ret_list = str(e).replace(",","").split("'")
@mayli
mayli / zipdb.py
Created April 5, 2012 13:58
Use a zipfile store a dict like k-v database
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# zipdb.py
# Use a zipfile store a dict like k-v database.
# Known bug: duplicate key(filenames) allowed
#
# Copyright 2012 mayli <mayli.he@gmail.com>
#
From c513decb40fc97173a7ac0bba5b7f8bcbb61ea3e Mon Sep 17 00:00:00 2001
From: fire855 <fire855@gmail.com>
Date: Sun, 30 Oct 2016 07:39:16 +0000
Subject: [PATCH] Framework_av MTK Patch
Change-Id: Ia8ab2f73ee51e27f21e4a6df047c307c5dd9965c
---
AV.zip | Bin 0 -> 27670 bytes
camera/Android.mk | 7 +
camera/Android.mk.orig | 79 +
@mauron85
mauron85 / keep-adb-running.sh
Created September 22, 2016 09:55
Workaround adb disconnecting issue on macOS Sierra
#!/bin/bash
cat << EOF
###########################################################
# Workaround adb disconnecting issue on macOS Sierra
#
# More info:
# https://code.google.com/p/android/issues/detail?id=219085
# credits to: hans...@meetme.com, vs...@google.com
###########################################################
@pingbird
pingbird / rt.dart
Created June 16, 2019 07:21
Web raytracer in Dart
import 'dart:html';
import 'dart:math';
import 'dart:typed_data';
import 'package:vector_math/vector_math.dart';
// Base class for all objects in a raytraced scene
abstract class RTObject {
// Get the delta for a ray intersection, null otherwise
double intersect(Ray ray);
@Kingson
Kingson / Douban_movie_query.py
Last active June 16, 2020 07:42
豆瓣电影查询助手V3.0 #增加给新关注的用户自动返回“欢迎关注豆瓣电影,输入电影名称即可快速查询电影讯息哦!”信息的功能 #大力丰富注释和docstring信息,以帮助后来者能快速上手。
#! /usr/bin/env python
# coding=utf-8
__author__ = 'jszhou'
from bottle import *
import hashlib
import xml.etree.ElementTree as ET
import urllib2
# import requests
import json
@ionrock
ionrock / lockfile.py
Created June 29, 2012 04:14
A file locking example
"""
A file lock implementation that tries to avoid platform specific
issues. It is inspired by a whole bunch of different implementations
listed below.
- https://bitbucket.org/jaraco/yg.lockfile/src/6c448dcbf6e5/yg/lockfile/__init__.py
- http://svn.zope.org/zc.lockfile/trunk/src/zc/lockfile/__init__.py?rev=121133&view=markup
- http://stackoverflow.com/questions/489861/locking-a-file-in-python
- http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/
- http://packages.python.org/lockfile/lockfile.html
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
@wobbals
wobbals / AvcEncoder.java
Created October 31, 2012 22:46
MediaCodec encoder sample
package com.opentok.media.avc;
import java.io.IOException;
import java.nio.ByteBuffer;
import android.media.MediaCodec;
import android.media.MediaCodecInfo;
import android.media.MediaFormat;
public class AvcEncoder {
@dervn
dervn / re.py
Created March 8, 2011 02:08
Python中过滤HTML标签的函数
#用正则简单过滤html的<>标签
import re
str = "<img /><a>srcd</a>hello</br><br/>"
str = re.sub(r'</?\w+[^>]*>','',str)
print str