Skip to content

Instantly share code, notes, and snippets.

@nelstrom
nelstrom / getting-vim-with-clipboard-support.md
Created November 14, 2013 23:04
Original draft of [Getting Vim with `+clipboard` support](http://vimcasts.org/blog/2013/11/getting-vim-with-clipboard-support/). Shows what I know!

On OS X

On OS X Mavericks, Apple ships Vim version 7.3 with -clipboard. Here's the gist from running [/usr/bin/vim --version on Mavericks][10.9] (and [the same on Mountain Lion][10.8]). Shame on you Apple!

If you [use Homebrew][brew.sh], you can get Vim with +clipboard by running:

brew install vim

Here's a gist from running [/usr/local/bin/vim --version][brew].

@hgomez
hgomez / download-java8.sh
Created March 19, 2014 20:39
wget to download Java 8
wget --continue --no-check-certificate -O jdk-8-linux-x64.tar.gz --header Cookie: oraclelicense=a http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-x64.tar.gz
@fairlight1337
fairlight1337 / hsvrgb-cpp
Created June 2, 2014 07:39
Simple RGB/HSV conversion in C++
// Copyright (c) 2014, Jan Winkler <winkler@cs.uni-bremen.de>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
@Mattze96
Mattze96 / bot.lua
Created March 30, 2015 06:47
telegram-cli lua file api
print ("bot v1.0")
now = os.time()
home_dir = "/home/matthias/"
function send_msg_cb(cb_extra, success, result)
if success then
return
end
end

Making a PDF + Bootable ISO Hybrid Polyglot

If you've not seen my résumé, that is what this post is about, and you should probably look at it first to get an idea of what's happening.

A Tale of Two Files

PDF and ISO9660 are two very different file formats. PDF is actually a surprisingly human-readable (but, sadly, not very human-writable) plain-text format, technically descended from PostScript. PDF is not very forgiving on changes, as it stores tables of offsets to various elements, so it is very difficult to insert or remove content manually without going through a robust PDF manipulation library.

ISO9660 is a disk filesystem, meant to be written once and read many times on many different kinds of hardware. As it is sector-based, it expects data structures to be at particular absolute offsets.

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active June 20, 2024 23:52
Hyperlinks in Terminal Emulators
@scragly
scragly / discord_emoji.md
Last active May 28, 2024 11:22
Emoji for Discord Bots

Discord Emoji

Note: This is written for those using Python 3 and discord.py, so if you're using something else please reference the relevant documentation for your language or library if you choose to use this as a general reference.

On Discord, there are two different emoji types:

Each needs to be handled differently, as while unicode emoji are just simple unicode characters, Discord custom emoji are special objects available only in Discord, belonging to a specific Discord guild and having their own snowflake ID.

// ==UserScript==
// @name Twitch Channel Points autoclaimer
// @version 1.0.0
// @description Automatically clicks the chest to claim the Twitch channel points
// @author jammy
// @match https://twitch.tv/*
// @match https://www.twitch.tv/*
// @grant none
// ==/UserScript==
@guac42
guac42 / music_bot_example.py
Last active December 2, 2022 22:56 — forked from vbe0201/music_bot_example.py
A simple music bot written using discord.py rewrite and youtube_dl.
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 Valentin B.
A simple music bot written in discord.py using youtube-dl.
Though it's a simple example, music bots are complex and require much time and knowledge until they work perfectly.
Use this as an example or a base for your own bot and extend it as you want. If there are any bugs, please let me know.
Requirements:
Python 3.5+
pip install -U discord.py pynacl youtube-dl
@8dcc
8dcc / csgo-autoexec.cfg
Last active November 17, 2023 23:03
My personal csgo/tf2 autoexec
echo
echo "⠀⠀⠀⠀⠀⢀⣴⡾⠿⠿⠿⠿⢶⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀"
echo "⠀⠀⠀⠀⢠⣿⠁⠀⠀⠀⣀⣀⣀⣈⣻⣷⡄⠀⠀⠀⠀⠀⠀⠀⠀"
echo "⠀⠀⠀⠀⣾⡇⠀⠀⣾⣟⠛⠋⠉⠉⠙⠛⢷⣄⠀⠀⠀⠀⠀⠀⠀"
echo "⢀⣤⣴⣶⣿⠀⠀⢸⣿⣿⣧⠀⠀⠀⠀⢀⣀⢹⡆⠀⠀⠀⠀⠀⠀"
echo "⢸⡏⠀⢸⣿⠀⠀⠀⢿⣿⣿⣷⣶⣶⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀"
echo "⣼⡇⠀⢸⣿⠀⠀⠀⠈⠻⠿⣿⣿⠿⠿⠛⢻⡇⠀⠀⠀⠀⠀⠀⠀"
echo "⣿⡇⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣼⣷⣶⣶⣶⣤⡀⠀⠀"
echo "⣿⡇⠀⢸⣿⠀⠀⠀⠀⠀⠀⣀⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀"
echo "⢻⡇⠀⢸⣿⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⡿⠿⣿⣿⣿⣿⡇"