Skip to content

Instantly share code, notes, and snippets.

View daleffe's full-sized avatar
💭
I may be slow to respond.

Guilherme Roberge Daleffe daleffe

💭
I may be slow to respond.
View GitHub Profile
@asheroto
asheroto / README.md
Last active March 20, 2025 14:41
Easily install and configure GeoIP for use with iptables which enables you to block/allow entire countries.

Configure GeoIP for iptables

This script configures GeoIP for use with iptables. Installs Linux headers, uses xtables-addons, uses latest db-ip.com database, fixes dependencies, loads xt_geoip module.

Supports colored message using ANSI escape codes. 😎

Run the script as root or with sudo.

Script Functionality

@Explosion-Scratch
Explosion-Scratch / Compress string.js
Created November 1, 2021 18:51
Compress string using gzip and native browser APIs
function compress(string, encoding) {
const byteArray = new TextEncoder().encode(string);
const cs = new CompressionStream(encoding);
const writer = cs.writable.getWriter();
writer.write(byteArray);
writer.close();
return new Response(cs.readable).arrayBuffer();
}
function decompress(byteArray, encoding) {
@reigningshells
reigningshells / DllExportLister.cs
Created September 5, 2021 02:55
Simple C# program to list exports of 32 and 64 bit DLLs - output mirrored from dumpbin /exports
using System;
using System.Linq;
using System.Runtime.InteropServices;
namespace DLLExportLister
{
class Program
{
// Can't use sizeof for IMAGE_SECTION_HEADER because of unmanaged type
public const int SizeOfImageSectionHeader = 40;
@viniciussanchez
viniciussanchez / formData.pas
Last active January 17, 2024 17:29
How to send multipart/form-data with Delphi using THTTPClient
uses System.Net.HttpClient, System.Net.Mime;
function Send: string;
var
LRequest: THTTPClient;
LFormData: TMultipartFormData;
LResponse: TStringStream;
begin
LRequest := THTTPClient.Create;
LFormData := TMultipartFormData.Create();
@eduardoflorence
eduardoflorence / main.dart
Last active October 15, 2024 01:44
GetX - Sample Drawer
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(
navigatorKey: Get.key,
initialRoute: '/home',
getPages: [
GetPage(
name: '/home',
@eduardoflorence
eduardoflorence / main.dart
Created December 14, 2020 22:48
GetX - Sample TabBar
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(GetMaterialApp(home: Home()));
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
@ishad0w
ishad0w / sources.list
Created April 30, 2020 16:55
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@seidme
seidme / puppies-store.service.ts
Created April 5, 2020 01:55
An example of simple immutable RxJs store in Angular.
import { Injectable } from '@angular/core';
import { BehaviorSubject, Subject } from 'rxjs';
import { PuppiesModule } from './puppies.module';
import { Puppy } from './puppy.model';
@Injectable({ providedIn: PuppiesModule })
export class PuppiesStoreService {
// Make _puppiesSource private so it's not accessible from the outside,
// expose it as puppies$ observable (read-only) instead.