Skip to content

Instantly share code, notes, and snippets.

View xlanor's full-sized avatar
❄️
Freezing

jingkai. xlanor

❄️
Freezing
  • praying for retirement before layoffs.
  • London, United Kingdom
  • 20:32 (UTC)
View GitHub Profile
"LD_* scout runtime" information:
{
"steam-runtime-system-info" : {
"version" : "0.20240301.0+srt1",
"path" : "/home/jingkai/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/bin/steam-runtime-system-info"
},
"can-write-uinput" : true,
"steam-installation" : {
"path" : "/home/jingkai/.local/share/Steam",
"data_path" : "/home/jingkai/.local/share/Steam",
@xlanor
xlanor / archlinux376.md
Last active July 2, 2019 13:21
CSCI376 - building on archlinux.

Setup for CSCI376 multicore & GPU processing for an Arch Linux system

To install amdapp-sdk:
Using yay,

yay -S --editmenu amdapp-sdk


Edit PKGBuild, remove:

  • !upx (depreceated pacman 5.10)\
@xlanor
xlanor / ext_eucli.py
Last active April 20, 2019 12:06
Extended Euclidean Algorithm Table Method
#! /usr/bin/env python3
#
# <THE BSD-3 LICENSE> https://opensource.org/licenses/BSD-3-Clause
# Copyright (c) 2019, Jing Kai Tan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
@xlanor
xlanor / samplescript.py
Created October 3, 2017 07:08
samplescript.py
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from contextlib import closing
from bs4 import BeautifulSoup
import re
url = 'https://simconnect.simge.edu.sg/psp/paprd/EMPLOYEE/HRMS/s/WEBLIB_EOPPB.ISCRIPT1.FieldFormula.Iscript_SM_Redirect?cmd=login'
url2 = 'https://simconnect.simge.edu.sg/psp/paprd_2/EMPLOYEE/HRMS/c/SA_LEARNER_SERVICES.SSR_SSENRL_LIST.GBL?Page=SSR_SSENRL_LIST&Action=A&TargetFrameName=None'
@xlanor
xlanor / instruction.txt
Created September 29, 2017 01:59
Installing Discord with copr on Fedora26
Using this copr repo https://copr.fedorainfracloud.org/coprs/tcg/discord/
dnf copr enable tcg/discord
dnf install Discord-installer
@xlanor
xlanor / abrtcmd.txt
Created September 28, 2017 16:20
Fedora 26 - Disable abrt
#ABRT was spamming my fedora system with updates nonstop.
sudo systemctl -t service | grep abrt
sudo systemctl stop abrt-journal-core.service
sudo systemctl disable abrt-journal-core.service
sudo systemctl stop abrt-oops.service
sudo systemctl disable abrt-oops.service
sudo systemctl stop abrt-xorg.service
sudo systemctl disable abrt-xorg.service
sudo systemctl stop abrtd.service
<?php
include('simple_html_dom.php');
include('connection.php');
$sitemap = 'http://www.todayonline.com/sitemap';
$rsslist = array();
$htmlsite = file_get_html($sitemap);
$zerolv = $htmlsite->find('div[class=zerolevel]');
//TodayOnline's sitemap dom has
foreach ($zerolv as $row)
{
else:
strippedbinid = binid.strip()
if not strippedbinid: #empty bin, filled with space. no_bin
cur.execute("""SELECT bin_id, quantity
FROM Stockage
WHERE sku_id = %s
AND user_id = %s
AND quantity != %s
ORDER BY (expiry_datetime is NULL),(expiry_datetime = '0000-00-00 00:00:00'), expiry_datetime ASC
LIMIT 1""", (sku, user_id,0,))
@xlanor
xlanor / readcsv.php
Last active July 24, 2017 08:08
Pulling data from a CSV file and working with database mechanics.
<?php
include ('connection.php');
$csvFile = file('sales_by_biz_details.csv');
$csv = array_map('str_getcsv', $csvFile);
$headers = $csv[0];
unset($csv[0]);
$rowsWithKeys = [];
foreach ($csv as $row)
@xlanor
xlanor / DescriptionController.php
Last active July 17, 2017 10:16
Display from mySQL using Morris
<?php
include 'connection.php';
include 'productmodel.php';
$desc = $rn['proDesc_text'];
echo $desc;
//short and simple :3
?>