Skip to content

Instantly share code, notes, and snippets.

View TACIXAT's full-sized avatar
🌴
Good life

TACIXAT TACIXAT

🌴
Good life
View GitHub Profile
@Treeki
Treeki / TurnipPrices.cpp
Last active April 5, 2024 13:55
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@ankitshekhawat
ankitshekhawat / PIL_to_datauri.py
Last active December 6, 2021 05:53
Convert PIL image to DataURI
#python3
def pil2datauri(img):
#converts PIL image to datauri
data = BytesIO()
img.save(data, "JPEG")
data64 = base64.b64encode(data.getvalue())
return u'data:img/jpeg;base64,'+data64.decode('utf-8')
@illia-v
illia-v / sha512.py
Last active April 8, 2024 04:54
Simple pure Python 3.6 implementation of SHA-512 algorithm
#!/usr/bin/env python3.6
__author__ = 'Illia Volochii'
__license__ = 'MIT'
import binascii
import struct
initial_hash = (
0x6a09e667f3bcc908,
0xbb67ae8584caa73b,
@samdutton
samdutton / sample.vtt
Created February 2, 2018 01:52
Sample WebVTT caption file
WEBVTT
00:00:00.500 --> 00:00:02.000
The Web is always changing
00:00:02.500 --> 00:00:04.300
and the way we access it is changing
@jozsefsallai
jozsefsallai / GoHTML.sublime-syntax
Last active February 15, 2024 12:05
Go HTML template syntax highlighting for Sublime Text
%YAML 1.2
---
name: 'GoHTML'
file_extensions:
- gohtml
- html.go
scope: text.html.gohtml
contexts:
main:
- match: ''
@ebraminio
ebraminio / upload.go
Last active March 22, 2023 06:01
golang upload client and server
// curl -X POST -H "Content-Type: application/octet-stream" --data-binary '@filename' http://127.0.0.1:5050/upload
package main
import (
"fmt"
"io"
"net/http"
"os"
"time"
@potatoqualitee
potatoqualitee / Test-Faf.ps1
Last active February 24, 2021 15:11
Insanely fast CSV to SQL Server imports using the FAF technique (batched datasets and in-line multithreading)
<#
PowerShell, SqlBulkCopy and RunSpaces Speed Test
-- To be used for speed testing purposes with million.csv --
-- Will drop and recreate specified database if it exists --
This script will
- Automatically download the million row dataset if it doesn't exist
- Drop the specified database if it exists
@georgiana-gligor
georgiana-gligor / osx-pdf-from-markdown.markdown
Last active March 5, 2024 21:09
Markdown source for the "Create PDF files from Markdown sources in OSX" article

Create PDF files from Markdown sources in OSX

When [Markdown][markdown] appeared more than 10 years ago, it aimed to make it easier to express ideas in an easy-to-write plain text format. It offers a simple syntax that takes the writer focus away from the formatting, thus giving her time to focus on the actual content.

The market abunds of editors to be used for help with markdown. After a few attempts, I settled to Sublime and its browser preview plugin, which work great for me and have a small memory footprint to accomplish that. To pass the results around to other people, less technical, a markdown file and a bunch of images is not the best approach, so converting it to a more robust format like PDF seems like a much better choice.

[Pandoc][pandoc] is the swiss-army knife of converting documents between various formats. While being able to deal with heavy-weight formats like docx and epub, we will need it for the more lightweight markdown. To be able to generate PDF files, we need LaTeX. On OSX, the s

@F1LT3R
F1LT3R / Default (OSX)sublime-keymap.json
Last active October 23, 2023 20:04
word wrap with ctrl + shift + w in sublime-text
[
{ "keys": ["ctrl+shift+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"}}
]
// Thanks to "facelessuser"
// https://www.sublimetext.com/forum/viewtopic.php?f=3&t=6663
@mattes
mattes / check.go
Last active April 4, 2024 22:40
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}