Skip to content

Instantly share code, notes, and snippets.

View donjajo's full-sized avatar
🏠
Working from home

James John donjajo

🏠
Working from home
View GitHub Profile
@donjajo
donjajo / wilfred_algorithm.php
Last active September 6, 2017 21:49
Wilfred's Algorithm in PHP
<?php
$you = 1;
$p = 2;
$f = [ $you, $p ];
// Random conversation
$conv = mt_rand( 0, 3 );
// At the beginning set the last date of conversation
$cur_date = '2017-02-06';
$x[ $p ][ $you ] = [ $cur_date => $conv ];
export function load_cat_names() {
return dispatch => {
return fetch( '/?token=' + vitals.token, {
method : 'POST',
headers : {
'X-Requested-With' : 'XMLHttpRequest'
},
body : JSON.stringify({ action : 'cat_names' }),
credentials : 'same-origin'
})
@donjajo
donjajo / myFirstGUI.py
Last active February 28, 2016 17:04
My First Python GUI Program :D
#!/usr/bin/python
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import urllib2
class Form( QDialog ):
def __init__( self, parent = None ):
super( Form, self ).__init__( parent )