Skip to content

Instantly share code, notes, and snippets.

View fripSide's full-sized avatar
🎯
Focusing

fripSide fripSide

🎯
Focusing
View GitHub Profile
@fripSide
fripSide / IoT.bib
Created February 16, 2024 09:48
Most Used References for IoT Paper
% ----------------------------------
% IoT 论文常用引用
% ----------------------------------
% https://azure.microsoft.com/es-es/blog/iot-device-authentication-options/
@Misc{iot_auth,
Title = {{IoT Authentication}},
HowPublished = {\url{https://www.nabto.com/iot-device-authentication-comparison-guide/}},
}
% https://www.okta.com/identity-101/what-is-token-based-authentication/
@fripSide
fripSide / download.sh
Last active July 27, 2023 17:35
Run the arm32 VM (debian armhf) with Qemu
# Download all necessaries files into the `files` folder
# This script is taken from https://www.willhaley.com/blog/debian-arm-qemu/
pushd .
mkdir -p files && cd files
curl -O http://ftp.us.debian.org/debian/dists/stable/main/installer-armhf/current/images/cdrom/initrd.gz
curl -O http://ftp.us.debian.org/debian/dists/stable/main/installer-armhf/current/images/cdrom/vmlinuz
curl -O -L https://cdimage.debian.org/debian-cd/current/armhf/iso-dvd/debian-12.1.0-armhf-DVD-1.iso
@fripSide
fripSide / recursive_file_case_sensitive.py
Last active September 1, 2019 13:54
windows set directory file name case senstitive recursively
# encode=utf-8
import os
import sys
import subprocess
"""
or one line powershell command:
(Get-ChildItem -Recurse -Directory).FullName | ForEach-Object {fsutil.exe file setCaseSensitiveInfo $_ enable}
https://stackoverflow.com/questions/51591091/apply-setcasesensitiveinfo-recursively-to-all-folders-and-subfolders
@fripSide
fripSide / crawler.py
Created August 12, 2018 10:57
crawler for stocks
# coding: utf-8
__author__ = 'fripSide'
import os
import requests as r
import lxml.html as html
import re
import pandas as pd
"""
TODO:
1. 抓取股票名称
import openpyxl
from openpyxl import worksheet
from openpyxl.utils import range_boundaries
def patch_worksheet():
"""This monkeypatches Worksheet.merge_cells to remove cell deletion bug
https://bitbucket.org/openpyxl/openpyxl/issues/365/styling-merged-cells-isnt-working
Thank you to Sergey Pikhovkin for the fix
"""
@fripSide
fripSide / InputControl.cs
Last active September 1, 2019 13:55
Unity InputControl
//InputControl.cs by Azuline Studios© All Rights Reserved
//Manages button and axis input to be read by the other scripts.
using UnityEngine;
using System.Collections;
public class InputControl : MonoBehaviour {
private FPSPlayer FPSPlayerComponent;
//button states that are accessed by the other scripts
sudo apt-get install -y libgmp-dev libmpfr-dev libmpc-dev zlib1g-dev
wget ftp://ftp.gnu.org/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.bz2
tar vf gcc-5.3.0.tar.bz2
mkdir outdir
cd outdir
../gcc-5.3.0/configure --disable-checking --program-suffix=-5.3 --enable-languages=c,c++,go,objc --disable-multilib --with-system-zlib prefix=/usr/local/gcc-5.3
make && make install
# choose gcc-5.3
update-alternatives --install /usr/bin/gcc gcc /usr/local/gcc-5.3/bin/gcc-5.3 30
@fripSide
fripSide / unlock1.cc
Last active September 26, 2015 16:05
Android手机9宫格手势数量:787728 (16格,计算超时)
#include <memory>
#include <cassert>
/*
* @author snk
*
* 9 points: 787728
* 16 points: timeout
*/
@fripSide
fripSide / Test Javasript Closure.js
Last active December 18, 2015 02:39
When the code is running asynchronously, the for-loop will end before the value 'fi' is printed.As a result of closure,inner function 'testClosure' has access to variables fi of the outer function .But the value of 'fi' will not be set to 0 any more(the first for-loop is finished). So the output of the asynchronous code is 1-2-3-4-5-6.
var events = require('events');
var util = require('util');
//http://rainsilence.iteye.com/blog/1534720
var sleep = function(time) {
var startTime = new Date().getTime();
while(new Date().getTime() < startTime + time);
};
//non-blcoking