Skip to content

Instantly share code, notes, and snippets.

View lincerely's full-sized avatar
🕹️

Lincerely lincerely

🕹️
View GitHub Profile
@datacustodian
datacustodian / Document_Conversion.md
Last active December 7, 2023 15:22
Document Conversion

Document Conversion

This document outlines some ideas for document conversion on Linux and Mac OS X platforms using command line tools. Distribute documents as plain text using UTF-8 encoding whenever possible. Everyone should embrace the mantra "plain text is beautiful".

Document Metadata

Use file command to obtain basic metadata for most file formats. For image files make sure you have ImageMagick installed, then use identify command to extract image metadata.

Encoding Conversion

@bnolan
bnolan / container_sdl.cpp
Created April 15, 2017 06:10
SDL Container for litehtml
#include "container_sdl.h"
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
using namespace litehtml;
container_sdl::container_sdl(litehtml::context* html_context, SDL_Renderer* renderer){
@karpathy
karpathy / nes.py
Last active June 7, 2025 14:26
Natural Evolution Strategies (NES) toy example that optimizes a quadratic function
"""
A bare bones examples of optimizing a black-box function (f) using
Natural Evolution Strategies (NES), where the parameter distribution is a
gaussian of fixed standard deviation.
"""
import numpy as np
np.random.seed(0)
# the function we want to optimize
@chadlung
chadlung / main.go
Last active February 13, 2020 22:34
An example Go (golang) REST service that uses JWT (JSON Web Tokens) and Negroni http://www.giantflyingsaucer.com/blog/?p=5994
package main
// Generate RSA signing files via shell (adjust as needed):
//
// $ openssl genrsa -out app.rsa 1024
// $ openssl rsa -in app.rsa -pubout > app.rsa.pub
//
// Code borrowed and modified from the following sources:
// https://www.youtube.com/watch?v=dgJFeqeXVKw
// https://goo.gl/ofVjK4
@mihow
mihow / load_dotenv.sh
Last active July 18, 2025 07:10
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@andy0130tw
andy0130tw / 3-color-to-SAT-reduction.md
Last active May 27, 2024 06:04
3-color to SAT reduction

$\textsf{3-color} \leqslant \textsf{SAT}$

Written with StackEdit and the math expression can be rendered in its viewer.

We have proved that $\textsf{3-color}$ is $\textbf{NP}$-complete by reducing $\textsf{SAT}$ to $\textsf{3-color}$. Is there a polynomial-time reduction form $\textsf{3-color}$ to $\textsf{SAT}$? If there is, give one such reduction.

@lincerely
lincerely / midterm_note.md
Last active October 14, 2016 05:28
CS4295 Mobile app midterm note
@zlbruce
zlbruce / svg2icns
Created October 1, 2016 01:17
covert svg to icns (with imagemagick)
#!/bin/bash
echo "*** SVG 2 ICNS ***"
if [ $# -ne 1 ]; then
echo "Usage: svg2icns filename.svg"
exit 100
fi
filename="$1"
name=${filename%.*}
ext=${filename##*.}
echo "processing: $name"
@d3noob
d3noob / data.csv
Last active January 30, 2023 12:22
Axis Labels in v4
date close
1-May-12 58.13
30-Apr-12 53.98
27-Apr-12 67.00
26-Apr-12 89.70
25-Apr-12 99.00
24-Apr-12 130.28
23-Apr-12 166.70
20-Apr-12 234.98
19-Apr-12 345.44
@ntddk
ntddk / fx0.md
Last active June 20, 2023 06:17
国内版Fx0にAndroidをインストールする

必要なもの

  • Windowsがインストールされたマシン(Windows 10で動作確認済)

手順

  • Android SDKをインストールする
  • KingoRootをインストールする
  • Fx0をUSBケーブルでマシンにつなぐ
  • KingoRootを起動し,「ROOT」をクリック
  • 待つ
  • adb shellからsuする