Skip to content

Instantly share code, notes, and snippets.

View keefo's full-sized avatar
📺

Xu Lian keefo

📺
View GitHub Profile
@keefo
keefo / upgradable_smart_contract.sol
Created July 8, 2019 01:18 — forked from swordsoul646/upgradable_smart_contract.sol
ERC-1504 Upgradable Smart Contract
pragma solidity ^0.4.0;
import './SafeMath.sol';
/**
* Here is an example of upgradable contract, consisting of three parts:
* - Data contract keeps the resources (data) and is controlled by the Handler contract;
* - Handler contract (implements Handler interface) defines operations and provides services. This contract can be upgraded;
* - Upgrader contract (optional) deals with the voting mechanism and upgrades the Handler contract. The voters are pre-defined
* by the contract owner.
@keefo
keefo / answer.md
Last active May 25, 2021 07:21 — forked from Discord-AppBot/answer.md
AppBot - a Discord bot made for staff application management within Discord.

What are your hobbies?

Table cccssssfds

Syntax Description
Header Title
Paragraph Text
@keefo
keefo / area_to_geojson.py
Created July 7, 2019 17:14 — forked from RemiDesgrange/area_to_geojson.py
A simple script to transform the area of massif from meteofrance into a geojson.
from typing import Dict
BASE_URL = "http://www.meteofrance.com/mf3-rpc-portlet/js/datas/zones_AVDEPT{}.json"
DEPTS = ("73", "74", "05", "38")
import requests
from geojson import Feature, FeatureCollection
def get_area(dept: str) -> Dict:
r = requests.get(BASE_URL.format(dept))
<?php
/**
* Plugin Name: Another Syntax Highlighter
* Version: 0.1
* Plugin URI: https://norbertvajda.wordpress.com/
* Description: Just another syntax highligher plugin. It works with prism.js (https://prismjs.com/).
* Author: Norbert Vajda
* Author URI: https://norbertvajda.wordpress.com/
* Network: false
* Text Domain: ash
#!/bin/bash
URL='https://www.google.com/search?q='
QUERY=$(echo '' | dmenu -p "Search:")
if [ -n "$QUERY" ]; then
firefox "${URL}${QUERY}" 2> /dev/null
exec i3-msg [class="^Firefox$"] focus
fi
@keefo
keefo / merge_lists.py
Created July 7, 2019 17:14 — forked from eduzen/merge_lists.py
Merge arrays with duplicated elements
def merge_lists(aList, bList):
if not aList or not bList:
print("empty lists")
return aList + bList
c = []
while aList and bList:
if aList[0] < bList[0]:
c.append(aList.pop(0))
else:
@keefo
keefo / Main.kt
Created July 7, 2019 17:13
async/await comparison between Kotlin, C#, Typescript
import kotlinx.coroutines.delay
fun main() {
fireAndForget()
}
/* C#
public static async Task Main(string[] args)
{
fireAndForget();
##########
# Win10 Optimization Script With Extra GPD Win Tweaks
# Adapted version of https://github.com/Disassembler0/Win10-Initial-Setup-Script by Disassembler <disassembler@dasm.cz>
# Author: BlackDragonBE
# Version: v2.2.1 (2017-12-02)
# Copied from https://www.reddit.com/r/gpdwin/comments/6ipa6c/windows_10_optimization_script_for_gpd_win/
##########
# As a workaround for disabled script execution, run this command (without #) in an elevated PowerShell windows first and choose "all" if you're asked where to apply this:
# Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Isaac Newton

photo profil

Physicist, Mathematician, Cambridge professor.

Presentation

Standing on the shoulders of giants