Skip to content

Instantly share code, notes, and snippets.

@shihyu
shihyu / gist:b3718963cfbfdcdd1466abe0d7638ee9
Created October 10, 2016 18:20 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@shihyu
shihyu / best_wishes.py
Created November 13, 2016 17:09 — forked from tobocop2/best_wishes.py
Only death is real...
import facebook
import config
import time
import platform
def best_wishes():
'''
This function loads an access token stored in a
text file (these expire so they need to be stored on disk somehow).
It then securly accesses the facebook graph api. Once connected,
@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.
@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 / 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 / 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 / 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?
#!/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