Skip to content

Instantly share code, notes, and snippets.

View jeremy5189's full-sized avatar

Jeremy Yen jeremy5189

View GitHub Profile
import matplotlib
import matplotlib.font_manager as fm
!wget http://qinghe.com.tw/fonts/Noto%20Sans%20TC/regular.ttf
fm.fontManager.ttflist += fm.createFontList(['regular.ttf'])
matplotlib.rc('font', family='Noto Sans TC')
@jeremy5189
jeremy5189 / 01.sol
Created March 17, 2019 16:52
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity 0.4.24;
import "./CtfFramework.sol";
import "./SafeMath.sol";
contract Donation is CtfFramework{
using SafeMath for uint256;
uint256 public funds;
@jeremy5189
jeremy5189 / 01.sol
Created March 17, 2019 16:11
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity 0.4.24;
import "./CtfFramework.sol";
import "./SafeMath.sol";
contract Donation is CtfFramework{
using SafeMath for uint256;
uint256 public funds;
@jeremy5189
jeremy5189 / ballot.sol
Created March 6, 2019 10:18
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
# Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# Change ZSH theme
sed -i -e 's/robbyrussell/af-magic/' .zshrc
# Install vimrc
git clone --depth=1 git://github.com/amix/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_basic_vimrc.sh
# This is a simple echo bot using the decorator mechanism.
# It echoes any incoming text messages.
import subprocess
import commands
import telebot
from telebot import types
API_TOKEN = ''
bot = telebot.TeleBot(API_TOKEN)
javascript:(function()%7Bfunction callback()%7B(function(%24)%7Bvar jQuery%3D%24%3Bvar questions %3D %5B%5D%2Coptions %3D %5B%5D%2Ccount %3D 0%3B%24('%5Btype%3D"radio"%5D').each( function() %7Boptions.push(%24(this).attr('id'))%3Bcount%2B%2B%3Bif( count %25 5 %3D%3D 0 ) %7Bquestions.push(options)%3Boptions %3D %5B%5D%7D%7D)%3Bfor( key in questions ) %7Bvar rnd %3D Math.floor((Math.random() * 3) %2B 1)-1%3B%24('%23' %2B questions%5Bkey%5D%5Brnd%5D).attr('checked'%2C 'checked')%3B%7D%7D)(jQuery.noConflict(true))%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
#/bin/sh
du -k -d 1 | sort -nr | awk '
BEGIN {
split("KB,MB,GB,TB", Units, ",");
}
{
u = 1;
while ($1 >= 1024) {
$1 = $1 / 1024;
u += 1
This file has been truncated, but you can view the full file.
140.118.1.1 => ima1.pc-lab.im.ntust.edu.tw
140.118.1.2 => ima2.im.ntust.edu.tw
140.118.1.3 => server1.im.ntust.edu.tw
140.118.1.4 => ima4.im.ntust.edu.tw
140.118.1.5 => ima5.im.ntust.edu.tw
140.118.1.6 => ima6.im.ntust.edu.tw
140.118.1.7 => ima7.im.ntust.edu.tw
140.118.1.8 => ima8.im.ntust.edu.tw
140.118.1.9 => ima9.im.ntust.edu.tw
140.118.1.10 => ima10.pc-lab.im.ntust.edu.tw
sudo apt install -y build-essential cmake git pkg-config
sudo apt install -y libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev
# For GUI
# sudo apt install -y libgtk2.0-dev
sudo apt install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt install -y libatlas-base-dev gfortran
# install pip