Skip to content

Instantly share code, notes, and snippets.

View dacap's full-sized avatar
🎨
Programming

David Capello dacap

🎨
Programming
View GitHub Profile
@rmartinho
rmartinho / hate.markdown
Last active July 15, 2020 01:33
I will hate you

Dear C++ library writer,

  1. If your library forces me to use new all over, I will hate you.

  2. If your library has types with bogus values, I will hate you.

  3. If the documentation for your library gets the terminology of its own domain wrong, I will hate you.

  4. If I say "My God, it's full of stars!" when I see the function signatures in your library, I will hate you.

/* So how does this work?
I'm using ANSI escape sequences to control the behavior of the terminal while
cat is outputting the text. I deliberately place these control sequences inside
comments so the C++ compiler doesn't try to treat them as code.*/
//
/*The commands in the fake code comment move the cursor to the left edge and
clear out the line, allowing the fake code to take the place of the real code.
And this explanation uses similar commands to wipe itself out too. */
//
#include <cstdio>
@manpages
manpages / the-case-for-gist-blogging.org
Created April 28, 2012 06:16
Why do I love to use gist as a blog engine?

The case for Gist blogging

Why to bother?

The posts people write in blogs can be classified in two groups:

  • those that are going to be (or should be) maintained, expressing the real time information (like books one reads or read, todo lists, lecture notes, etc),
  • those that express the momentary thoughts of a writer on an event or activity.

Maintaining the post

While first ones can be managed using standart blog engines (livejournal, blogger, etc) via «Edit post» option, that’s hardly

@ericoporto
ericoporto / Generate Normal Map.lua
Created March 10, 2019 02:29 — forked from ruccho/Generate Normal Map.lua
Lua script for Aseprite that generates normal map automatically.
----------------------------------------------------------------------
-- Generate Normal Map
--
-- It works only for RGB color mode.
----------------------------------------------------------------------
if app.apiVersion < 1 then
return app.alert("This script requires Aseprite v1.2.10-beta3")
end
// g++ test.cpp --std=c++11 -lpthread -O2
//#ifdef WIN32 <- stdafx breaks this ifdef...
//#include "stdafx.h"
//#endif
#include <iostream>
#include <atomic>
#include <thread>
#include <vector>
@mislav
mislav / workflows-automerge.yml
Last active December 5, 2023 02:41
Using GitHub CLI from GitHub Actions
name: Auto-merge
on:
pull_request:
types: [opened]
jobs:
automerge:
runs-on: ubuntu-latest
@ryanchang
ryanchang / lldb_cheat_sheet.md
Last active March 12, 2024 11:03
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
@gerarldlee
gerarldlee / Experimenting with ChromeOS on VirtualBox.md
Last active March 24, 2024 23:51
Installing ChromeOS on VirtualBox using the NeverWare build

Installing ChromeOS on VirtualBox

  1. Download the NeverWare's ChromeOS build from http://www.neverware.com/freedownload

  2. Extract the *.bin.zip

  3. Convert it to VDI. vboxmanage convertdd chromiumos_image.bin chromiumos_image.vdi

  4. mv chromiumis_image.vdi C:\t\v\chromeos\

----------------------------------------------------------------------
-- Generate Normal Map
--
-- It works only for RGB color mode.
----------------------------------------------------------------------
if app.apiVersion < 1 then
return app.alert("This script requires Aseprite v1.2.10-beta3")
end
@MichaelPote
MichaelPote / himawari.ps1
Created February 3, 2016 19:11
Windows Powershell Script to download the latest image from the Himawari-8 satelite, combine the tiles into a single image, convert to jpg and then set as the desktop background.
#
# Himawari-8 Downloader
#
#
#
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image,
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background.
#
# http://himawari8.nict.go.jp/himawari8-image.htm
#