Skip to content

Instantly share code, notes, and snippets.

@shihyu
shihyu / trace.py
Created February 20, 2018 09:09 — forked from bnoordhuis/trace.py
trace function calls with gdb
#!/usr/bin/env python
import re
import sys
import subprocess
import tempfile
nm = 'nm'
gdb = 'gdb'
@shihyu
shihyu / campsaver.py
Created December 21, 2017 12:14 — forked from tai271828/campsaver.py
A campsaver cwarler to watch the price of the commodity you want to have
#!/usr/bin/env python3
# Mail service should only be run from a system with postfix installed.
# e.g. sudo apt-get install postfix on Ubuntu Xenial
import logging
import requests
from bs4 import BeautifulSoup
# For mail notification service
import os
import smtplib
from email.mime.multipart import MIMEMultipart
#!/usr/bin/python
from Tkinter import *
import numpy
import math
# Transmisor de una senal
class Transmitter:
def __init__(self, ID, canvas, coordinates, strength=50, color="gray"):
self.id = ID # ID del transmisor
@shihyu
shihyu / pandas_dbms.py
Created April 21, 2017 13:58 — forked from peteWT/pandas_dbms.py
Python PANDAS : load and save Dataframes to sqlite, MySQL, Oracle, Postgres
# -*- coding: utf-8 -*-
"""
example use of pandas with oracle mysql postgresql sqlite
lightly tested.
to do:
save/restore index (how to check table existence? just do select count(*)?),
finish odbc,
add booleans?,
sql_server?
@shihyu
shihyu / jni_testing.c
Created April 20, 2017 07:03 — forked from arn-e/jni_testing.c
jni_conversion_test.c
#include <stdio.h>
#include <stdlib.h>
struct jintArray
{
int size;
int *elements;
};
struct env_type
@shihyu
shihyu / example.c
Created March 28, 2017 14:33 — forked from waveacme/example.c
linux list.h for userspace
#include <stdlib.h>
#include <stdio.h>
#include "list.h"
typedef struct episode {
int epid;
struct list_head list;
} episode_t;
@shihyu
shihyu / example.c
Created March 28, 2017 14:33 — forked from waveacme/example.c
linux list.h for userspace
#include <stdlib.h>
#include <stdio.h>
#include "list.h"
typedef struct episode {
int epid;
struct list_head list;
} episode_t;
@shihyu
shihyu / SQLite
Created January 10, 2017 14:23 — forked from tfiers/SQLite
Facebook post insight & event attendees tracker
-- Export to csv via SQLite Database Browser:
create table promo_post_data as select * from pagepostdata where post_name='Promo-post'
-- Export to csv via SQLite CLI:
sqlite> .header on
sqlite> .output c:/work/dataout.csv
sqlite> .mode csv
sqlite> SELECT * FROM pagepostdata WHERE post_name='Promo-post'
sqlite> .output stdout
@shihyu
shihyu / FacebookTestAccount.py
Created December 25, 2016 13:43 — forked from zonble/FacebookTestAccount.py
A tool which helps to create and delete test account for Facebook.
import urllib, urllib2, json
'''
The ``FacebookTestUserManager`` module
======================================
Author: Weizhong Yang <zonble at gmail dot com>
A tool which helps to create and delete test account for Facebook.