Skip to content

Instantly share code, notes, and snippets.

View TACIXAT's full-sized avatar
🌴
Good life

TACIXAT TACIXAT

🌴
Good life
View GitHub Profile
@jniltinho
jniltinho / get_external_ip.go
Created March 26, 2014 17:02
Get External IP Golang
package main
/*
URL: http://myexternalip.com/#golang
*/
import (
"io"
"net/http"
@mbostock
mbostock / .block
Last active February 2, 2021 04:59
Build Your Own Graph!
license: gpl-3.0
redirect: https://observablehq.com/@d3/build-your-own-graph
@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
@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')
@gin1314
gin1314 / test.c
Created August 23, 2012 08:54
C++ : Win32 API InternetOpen example
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <winsock.h>
#include <wininet.h>
#include <shellapi.h>
#include <mmsystem.h>
typedef struct vs {
char host[128];
@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"
@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
@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: ''
@jmnwong
jmnwong / ST2 Cycle Tabbing
Created June 28, 2013 15:24
Makes CTRL-Tab cycle tabs in order for Sublime Text.
Put in (Preferences -> Key Bindings - User):
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }
@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