Skip to content

Instantly share code, notes, and snippets.

@juque
juque / MySQL-Chile:regiones-provincias-comunas
Created July 6, 2010 19:32
Chile: Regiones, Provincias, Comunas
/* Estructura y Datos de las Regiones, Provincias */
/* y Comunas de Chile. */
/* */
/* Fecha: Julio 2010 */
/* Autor: Juan Pablo Aqueveque - juque.cl */
--
-- Comunas
--
DROP TABLE IF EXISTS `comunas`;
@holblin
holblin / ios_sleep_data_receiver.yaml
Created April 10, 2024 23:52
IOS sleep data receiver
blueprint:
name: IOS Sleep data receiver
description: >-
A script that receive data for IOS about sleep bedtime.
domain: script
input:
next_alarm:
name: Next alarm input
description: Datetime input helper to save the next alarm
selector:
@sts10
sts10 / rust-command-line-utilities.markdown
Last active April 29, 2024 19:49
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@oneamtu
oneamtu / gtest.cmake
Created September 16, 2012 20:38
How to add google test as an downloadable external project
########################### GTEST
# Enable ExternalProject CMake module
INCLUDE(ExternalProject)
# Set default ExternalProject root directory
SET_DIRECTORY_PROPERTIES(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/third_party)
# Add gtest
# http://stackoverflow.com/questions/9689183/cmake-googletest
ExternalProject_Add(
@streamich
streamich / lambda.js
Last active April 29, 2024 19:45 — forked from maxbeatty/lambda.js
using node-postgres (`pg`) in AWS Lambda
import λ from "apex.js";
import { Pool } from "pg";
// connection details inherited from environment
const pool = new Pool({
max: 1,
min: 0,
idleTimeoutMillis: 120000,
connectionTimeoutMillis: 10000
});
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 29, 2024 19:53
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@wojteklu
wojteklu / clean_code.md
Last active April 29, 2024 19:43
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active April 29, 2024 19:42
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@charlieman
charlieman / WindowStateSaveHelper.cs
Created May 10, 2014 21:24
Save and restore a Window's Position, Size and State
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
namespace WindowStateSave
{
/// <summary>
/// Helper class that saves the window's state to a User Settings string
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)