Skip to content

Instantly share code, notes, and snippets.

slowkow /
Created July 19, 2018 14:10
Remove all traces of emoji from a text file.
#!/usr/bin/env python
Remove emoji from a text file and print it to stdout.
python input.txt > output.txt
View streaming-json-parser.ts
const CH_BRACE_L = 0x7b as const;
const CH_BRACE_R = 0x7d as const;
const CH_SQUARE_L = 0x5b as const;
const CH_SQUARE_R = 0x5d as const;
const CH_QUOTE_D = 0x22 as const;
const CH_ESCAPE = 0x5c as const;
const CH_COMMA = 0x2c as const;
const CH_COLON = 0x3a as const;
const CH_DOT = 0x2e as const;
const CH_MINUS = 0x2d as const;
# Author: An Shen
# Date: 2023-01-30
. /etc/profile
function log(){
echo "[$(date +'%Y-%m-%d %H:%M:%S')] - $1"
View gist:747922
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"""><html><head><link rel="canonical" href=""/><title>Excavations at Carnac (Brittany): a ... - Google Books</title><script>(function(){function a(d){this.t={};this.tick=function(e,f,b){b=b?b:(new Date).getTime();this.t[e]=[b,f]};this.tick("start",null,d)}var c=new a;window.jstiming={Timer:a,load:c};try{var g=null;if(;if(g==null)if(window.gtbExternal)g=window.gtbExternal.pageT();if(g==null)if(window.external)g=window.external.pageT;if(g)}catch(h){};})();
</script><script>(function() {var preloadImg = document.createElement('img');preloadImg.src = '';window['_OC_preload_image_url'] = preloadImg.src;})();</script><link rel="stylesheet" href="/books/
78526Nasir /
Created December 20, 2017 16:57
Secant method implementation in java.
@ Author: Nasir Islam Sujan
@ GitHub:
* This solution was written for
* the following equation
* f(x) = x^3 - 0.165x^2 + 3.993 * 10^-4
You need an absolute relative approximate error of 5% or less.
ksafranski / Common-Currency.json
Last active June 4, 2023 14:23
Common Currency Codes in JSON
View Common-Currency.json
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
raspberrypisig / CMakeLists.txt
Last active June 4, 2023 14:18
msys2 vscode integration c++ vcpkg cmake
View CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project (roguelike-firststab)
set(SDL2_DIR "C:/msys64/mingw64/bin/vcpkg/installed/x64-mingw-static/share/sdl2")
set(glad_DIR "C:/msys64/mingw64/bin/vcpkg/installed/x64-mingw-static/share/glad")
set(lodepng-c_DIR "C:/msys64/mingw64/bin/vcpkg/installed/x64-mingw-static/share/lodepng-c")
set(libtcod_DIR "C:/msys64/mingw64/bin/vcpkg/installed/x64-mingw-static/share/libtcod")
find_package(libtcod CONFIG REQUIRED)
add_executable(roguelike-firststab main.cpp)
target_link_libraries(roguelike-firststab PRIVATE libtcod::libtcod)
Skyross /
Last active June 4, 2023 14:17
Celery Task with lock
from celery import Task
from django.conf import settings
from django.core.cache import caches
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
# noinspection PyAbstractClass
class TaskWithLock(Task):
mailme-gx /
Last active June 4, 2023 14:16 — forked from targzeta/
Traslates .eml file to maildir format.
# Copyright (C) 2015
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
View FloatingPanel.swift
class FloatingPanel: NSPanel {
init(contentRect: NSRect, backing: NSWindow.BackingStoreType, defer flag: Bool) {
// Not sure if .titled does affect anything here. Kept it because I think it might help with accessibility but I did not test that.
super.init(contentRect: contentRect, styleMask: [.nonactivatingPanel, .resizable, .closable, .fullSizeContentView], backing: backing, defer: flag)
// Set this if you want the panel to remember its size/position
// self.setFrameAutosaveName("a unique name")
// Allow the pannel to be on top of almost all other windows