Skip to content

Instantly share code, notes, and snippets.

View luizfernandonb's full-sized avatar

Luiz luizfernandonb

  • Bezerros, Pernambuco
  • 13:45 (UTC -03:00)
View GitHub Profile
@ocpu
ocpu / build.gradle
Created August 27, 2017 16:32
Minecraft Forge build.gradle in somewhat detail
buildscript {
repositories {
// Adds the jcenter repository
jcenter()
// Add minecraft forge repositories
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
@fsmv
fsmv / miniupnpcTest.c
Created September 12, 2014 19:47
Miniupnpc Port Forwarding Example
#include <stdio.h>
#include <arpa/inet.h> //INET6_ADDRSTRLEN
#include <miniupnpc/miniupnpc.h>
#include <miniupnpc/upnpcommands.h>
int main(int argc, char *argv[]) {
int error = 0;
//get a list of upnp devices (asks on the broadcast address and returns the responses)
struct UPNPDev *upnp_dev = upnpDiscover(1000, //timeout in milliseconds
NULL, //multicast address, default = "239.255.255.250"
@Arzio
Arzio / build.gradle
Last active October 4, 2022 17:54
Fix Forge 1.7.10 HTTPS error during Gradle operations
// The comments with [HTTPS FIX] tag refers to the parts that fixes the issue.
buildscript {
repositories {
// [HTTPS FIX] Replace mavenCentral() with the code block below
maven {
url "https://repo1.maven.org/maven2"
}
@heronmedeiros
heronmedeiros / .vimrc
Created August 1, 2011 19:03 — forked from henriquegogo/.vimrc
Meu arquivo de configuração .vimrc do Vim
""""""""""""""""""""""""""""""""""""""""
" CONFIGURAÇÕES GOGS - WWW.GOGS.COM.BR "
""""""""""""""""""""""""""""""""""""""""
set number " Numera as linhas
set linebreak " Quebra a linha sem quebrar a palavra
set nobackup " Não salva arquivos de backup~
set wildmode=longest,list " Completa o comando com TAB igual o bash
set ignorecase " Ignora o case sensitive nas buscas
set smartcase " Se tiver alguma letra maiúscula, ativa o case sensitive
set gdefault " Sempre substitui todas as palavras, não só a primeira
@juniorcesarabreu
juniorcesarabreu / memset.md
Last active November 17, 2023 12:05
A função memset(str, c, n) copia o caracter c (um unsigned char) para os n primeiros caracteres da string apontada por str.

Exemplo

#include <stdio.h>
#include <string.h>

int main ()
{
   char str[50];

 strcpy(str,"This is string.h library function");
@bantya
bantya / clear_apps_icon_cache.bat
Created November 6, 2017 09:52
bat: clear windows apps icon cache
@echo off
:: ie4uinit.exe -show
ie4uinit.exe -ClearIconCache
taskkill /IM explorer.exe /F
del /A /Q "%localappdata%\IconCache.db"
del /A /F /Q "%localappdata%\Microsoft\Windows\Explorer\iconcache*"
shutdown /r /f /t 00
@fedek6
fedek6 / removeSublimeContextMenu.bat
Created November 9, 2017 12:30
Remove Sublime integration added by: roundand/OpenWithSublimeText3.bat
@echo off
rem add it for all file types
@reg delete "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /f
rem add it for folders
@reg delete "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /f
pause
@kylef
kylef / dict.c
Created March 27, 2009 17:11
A key/value dictionary system in C
/* A key/value dict system in C */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TEST TRUE /* Comment this line out to compile without a main function (used when including into another application). */
typedef struct dict_t_struct {
char *key;
void *value;
@richlander
richlander / modernizing-csharp9.md
Last active April 26, 2024 17:14
Modernizing a codebase for C# 9

Modernizing a codebase for C# 9

There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull example requires it.

Use the property pattern to replace IsNullorEmpty

Consider adopting the new property pattern, wherever you use IsNullOrEmpty.

string? hello = "hello world";
@iUltimateLP
iUltimateLP / libwebsocket_client.cpp
Created February 8, 2017 18:13
A simple, minimalistic websocket client using LibWebSocket
// Simple LibWebSockets test client
//////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include "libwebsocket/libwebsockets.h"