Skip to content

Instantly share code, notes, and snippets.

View crosslife's full-sized avatar

404NotFound crosslife

  • Netease Games
  • Hangzhou
View GitHub Profile
timers = {}
function after(delay, action, repeatable, after, tag)
local tag = tag or uid() -- uid returns a unique id every time it's called, "or" will resolve the expression to the result of uid() if tag is nil (the same as if not tag then tag = uid() end)
timers[tag] = {type = 'after', current_time = 0, delay = delay, action = action, repeatable = repeatable, after = after, tag = tag}
end
function tween(delay, target, source, method, after, tag)
local tag = tag or uid()
local initial_values = {}
@heardk
heardk / OneNote-to-MD.md
Last active March 27, 2024 03:02
Convert notes from OneNote into Markdown

Converting One Note to Markdown

This is an example of how to convert notes from OneNote into Markdown to use in other, less annoying Note applications. I am using PowerShell on Windows here, but other shell/scripting environments would work as well. If you want separate .md files, you'll need to export your OneNote pages separately. Exporting a section, or a selection of pages creates a single .docx file.

  • Download and install Pandoc
  • Export each of your note pages to a .docx (Word) format using OneNote export from the File menu
  • Gather all of these .docx files into a directory
  • Open directory in File Explorer
  • Open Powershell from the File Explorer using File -> Open Windows Powersell
  • Run the following command:
@lennart
lennart / aliases
Created June 3, 2015 11:05
Bash Alias for converting rgb values to hex, Usage: rgb2hex 12 245 14
alias rgb2hex='printf "#%02x%02x%02x\n"'
@touilleMan
touilleMan / SimpleHTTPServerWithUpload.py
Last active May 4, 2024 01:08 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@jtdp
jtdp / gist:5443297
Last active March 13, 2024 12:58
See changes before pulling from remote git repository
# fetch the changes from the remote
git fetch origin
# show commit logs of changes
git log master..origin/master
# show diffs of changes
git diff master..origin/master
# apply the changes by merge..