Skip to content

Instantly share code, notes, and snippets.

View toqueteos's full-sized avatar
🤠
Deleting code

Carlos Cobo toqueteos

🤠
Deleting code
View GitHub Profile

Data structures in Go with maps and slices

Sets:

set := make(map[string]bool)

// add to set
set["a"] = true 
@woutrbe
woutrbe / gist:3dad6d4c39c78d2956e9ae0a7a309112
Last active December 15, 2023 12:27
Deploy to Google Cloud Bucket from Gitlab CI/CD
build app:
image: node:6
stage: build
artifacts:
paths:
- public
script:
- npm install
- npm run build
# Your next stage won't have access to these files again, so copy it to a public directory

In a terminal start a server.

$ python -m SimpleHTTPServer 8000

In another terminal set up the cgroups freezer.

@gbraad
gbraad / Corefile
Last active November 26, 2021 06:10
Create a DNS Responder using CoreDNS
.:53 {
log
errors
#bind 127.0.0.1
proxy . /etc/resolv.conf
template IN A {
match "^(?P<a>[0-9]*)[.](?P<b>[0-9]*)[.](?P<c>[0-9]*)[.](?P<d>[0-9]*)[.](xip.io|nip.io|local|dev)[.]$"
@LotteMakesStuff
LotteMakesStuff / MinMaxAttribute.cs
Last active March 16, 2023 16:47
MinMax property drawer for Unity - Add a [MinMax] attribute to a property to draw a useful min/max setting slider.
// NOTE DONT put in an editor folder
using UnityEngine;
public class MinMaxAttribute : PropertyAttribute
{
public float MinLimit = 0;
public float MaxLimit = 1;
public bool ShowEditRange;
public bool ShowDebugValues;
@walm
walm / main.go
Last active July 26, 2024 10:38
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@kinifi
kinifi / AutoSave.cs
Created November 3, 2015 19:28
Auto Save the current open Unity 3D level every 30 seconds
/* Created by Chris Figueroa - @Kinifi
* Create a script called AutoSave.cs
*/
using UnityEngine;
using UnityEditor;
using System.Collections;
public class AutoSave : EditorWindow {
@jpillora
jpillora / sshd.go
Last active December 17, 2023 16:27
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@hjwp
hjwp / Dockerfile
Created August 1, 2014 11:53
Building a postgres docker image...
FROM ubuntu:trusty
MAINTAINER developers@pythonanywhere.com
# Add the PostgreSQL PGP key to verify their Debian packages.
# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
# Add PostgreSQL's repository. It contains the most recent stable release
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main 9.4" > /etc/apt/sources.list.d/pgdg.list