Skip to content

Instantly share code, notes, and snippets.

@DanPuzey
DanPuzey / Promise.cs
Last active May 21, 2024 11:47
Unity3d: promises for Coroutines
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Promises
{
/// <summary>
/// Contains extension methods that provide promise-like behaviour for coroutines.
/// </summary>
@fredhsu
fredhsu / ubuntudocker.sh
Last active May 21, 2024 11:46
Shell script to install Docker CE on ubuntu and post-install user configuration
#!/bin/bash
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
@minhoryang
minhoryang / Dockerfile
Last active May 21, 2024 11:46
docker-ubuntu-build-essential
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y --no-install-recommends apt-utils build-essential sudo git
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
USER docker
@StevenACoffman
StevenACoffman / ttrpg-scenario-design-procedures.md
Last active May 21, 2024 11:45
Tabletop Role Playing Game Scenario Design Recipes

There are a number of different approaches to designing a scenario/adventure/module.

In a Five Room Dungeon, the basic formula is:

  1. Entrance or Guardian
  2. Puzzle or Roleplaying Challenge
  3. Trick or Setback
  4. Climax, Big Battle, or Conflict
  5. Reward, Revelation, or Plot Twist

Justin Alexander's 5+5 Dungeon Recipe:

@KRostyslav
KRostyslav / tsconfig.json
Last active May 21, 2024 11:44
tsconfig.json с комментариями.
// Файл "tsconfig.json":
// - устанавливает корневой каталог проекта TypeScript;
// - выполняет настройку параметров компиляции;
// - устанавливает файлы проекта.
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта.
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта.
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга.
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути.
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию.
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json".
@stefansundin
stefansundin / requests_api.py
Last active May 21, 2024 11:41
Reusable class for Python requests library.
# http://docs.python-requests.org/en/master/api/
import requests
class RequestsApi:
def __init__(self, base_url, **kwargs):
self.base_url = base_url
self.session = requests.Session()
for arg in kwargs:
if isinstance(kwargs[arg], dict):
kwargs[arg] = self.__deep_merge(getattr(self.session, arg), kwargs[arg])
@quoha
quoha / Working-With-XCode
Created January 21, 2013 17:58
Using XCode with github
Using XCode with github
=======================
0. These steps were pulled from the documentation on github
1. Create an empty repository on GitHub
do not initialize with a README
2. Note the SSH path to the new repository
git@github.com:quoha/derp-octo-sansa.git
@lucasnogueira
lucasnogueira / Post-RubyRails.md
Created September 29, 2012 17:52
Para aprender Ruby e Rails

É difícil falar de Ruby sem mencionar seu framework web mais famoso, Ruby on Rails. Mas não adianta muito encarar o framework sem um prévio estudo da linguagem (o que de fato já observei acontecer inúmeras vezes). Esse post tem como intuito auxiliar na aprendizagem tanto da linguagem como do framework, para evitar que erros comuns como esse tornem a utilização de ambos um desastre.

Ruby

Ruby é uma linguagem de programação que apareceu para o mundo em 1995, criada por Yukihiro "Matz" Matsumoto. Tem como características o fato de ser uma linguagem de uso geral, com tipagem dinâmica e forte, orientada a objetos e que incorpora diversos paradigmas de programação, como o funcional e o imperativo.

Iniciantes

  • Ruby in Twenty Minutes - É o que o nome diz: um pequeno tutorial que promete não tomar mais do que 20 minutos do seu tempo. Se encarrega de mostrar como baixar e instalar o Ruby. Faz grande uso da IRB (Int
@raelgc
raelgc / Email Server (Linux, Unix, Mac).md
Last active May 21, 2024 11:31
Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"