Skip to content

Instantly share code, notes, and snippets.

View twinsant's full-sized avatar
💭
Coding

Atman An twinsant

💭
Coding
View GitHub Profile
print 'Hello Gist!'
@twinsant
twinsant / zbar_Makefile_am.patch
Last active December 18, 2015 21:49
Hacking ZBar Makefile.am
diff -r 38e78368283d Makefile.am
--- a/Makefile.am Sun Oct 14 23:02:08 2012 -0700
+++ b/Makefile.am Mon Jun 24 20:52:55 2013 +0800
@@ -27,24 +27,24 @@
if HAVE_PYTHON
include $(srcdir)/python/Makefile.am.inc
endif
-if HAVE_GTK
-include $(srcdir)/gtk/Makefile.am.inc
-pkgconfig_DATA += zbar-gtk.pc
diff -r 38e78368283d android/AndroidManifest.xml
--- a/android/AndroidManifest.xml Sun Oct 14 23:02:08 2012 -0700
+++ b/android/AndroidManifest.xml Mon Jun 24 21:01:24 2013 +0800
@@ -3,6 +3,7 @@
package="net.sourceforge.zbar.android"
android:versionCode="1"
android:versionName="1.0">
+ <uses-sdk android:minsdkversion="8" />
<application android:label="@string/app_name" >
<activity android:name="ACTIVITY_ENTRY_NAME"
@twinsant
twinsant / extract_eml_attachments.py
Created June 26, 2013 12:14
Extracts attachments from EML file.
import os
import email
if __name__ == '__main__':
eml = '~/Downloads/wm_2013062618492006332.jpg.eml'
try:
os.mkdir(os.path.expanduser('%s_' % eml))
except OSError:
pass
f = open(os.path.expanduser(eml))
@twinsant
twinsant / com.leapmotion.leapd.plist
Created July 26, 2013 14:48
Leap Motion lost file in Mac OS X 10.8.4. sudo launchctl load /Library/LaunchAgents/com.leapmotion.leapd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.leapmotion.leapd</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Leap Motion.app/Contents/MacOS/leapd</string>
</array>
@twinsant
twinsant / AI.Baidu.js
Created March 19, 2021 01:39
百度AI开发者社区数据统计
// ==UserScript==
// @name AI.Baidu
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 百度AI开发者社区数据统计
// @author twinsant
// @match https://ai.baidu.com/forum
// @grant none
// @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am twinsant on github.
  • I am twinsant (https://keybase.io/twinsant) on keybase.
  • I have a public key ASBgTqNEtYenzYRLWTka6zSu62lsfi6VGIrGpdebmcd9oQo

To claim this, I am signing this object:

@twinsant
twinsant / client.py
Created August 26, 2021 08:20
crawlab core hack
@staticmethod
def settings(directory=None):
if directory is None:
directory = os.path.abspath(os.curdir)
os.chdir(directory)
cp = get_scrapy_cfg()
settings_mod_name = cp.get('settings', 'default')
@twinsant
twinsant / ts.py
Created November 2, 2021 03:22
Alfred Workflows: Timestamp
import sys
import time
from datetime import datetime
query = "{query}"
ts = float(query)
if ts > time.time():
ts = ts/1000
dt = datetime.fromtimestamp(ts)
@twinsant
twinsant / ip.py
Created November 2, 2021 04:04
Alfred workflows: IP
import sys
import requests
query = "{query}"
r = requests.get('http://freeapi.ipip.net/%s' % query)
sys.stdout.write(r.text)