Skip to content

Instantly share code, notes, and snippets.

View KanagawaMarcos's full-sized avatar
:octocat:
F#, NixOS & Postgres

Kanagawa Marcos KanagawaMarcos

:octocat:
F#, NixOS & Postgres
View GitHub Profile
@yuga
yuga / redblacktree.py
Last active June 9, 2018 20:52
CLRS 2ndのRed-Black Tree あってるかどうか... 番兵のparent, left, right, keyは操作の都合上値置場として活用することがある(日本語版第二版P269)。
#!/bin/env python
# -*- coding: utf-8 -*-
class Color:
RED = 1
BLACK = 2
class Element:
def __init__(self, key):
self.key = key
@basham
basham / css-units-best-practices.md
Last active June 6, 2024 02:06
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@alexhawkins
alexhawkins / nativeJavaScript.js
Last active April 28, 2024 08:52
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 15, 2024 13:00
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@kala13x
kala13x / strtoken.c
Last active April 17, 2019 16:58
Thread safe alternative of the strtok() function
/*
* strtoken.c
*
* Copyleft (C) 2015 Sun Dro (a.k.a. kala13x)
*
* This source is thread safe alternative of the strtok().
* See usage of the get_token() below at main() function.
*/
@jadercorrea
jadercorrea / postgres config.sh
Created May 9, 2016 13:38
Postgres install commands for Elementary OS
Postgres
$ sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
$ wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-common
$ sudo apt-get install postgresql-9.3 libpq-dev
$ sudo -u postgres createuser username -s
@davoclavo
davoclavo / up-and-running-with-edeliver-on-do.md
Last active June 6, 2022 11:55 — forked from mattweldon/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new ubuntu droplet

Setup Server

@ondrik
ondrik / Dockerfile
Last active August 26, 2022 08:09 — forked from rmoehn/Dockerfile
Dockerfile for running Anki inside a Docker Container on Debian Stable
# Credits:
#
# - http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/
# - https://github.com/jfrazelle/dockerfiles/blob/master/spotify/Dockerfile
#
# Prepare (example):
#
# $ mkdir AnkiDocker
# $ cd AnkiDocker
# $ # Save this file to Dockerfile and adapt it to your needs.
@knowbody
knowbody / RNfontWeights.js
Created July 14, 2016 13:42
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
@leonardo-lemos
leonardo-lemos / correcao_acentuacao_telegram.md
Last active July 12, 2023 13:32
Como resolver o problema de acentuação do cliente Telegram no elementary OS/Ubuntu 16.04

Para resolver o problema de falta de suporte à acentuação no cliente Telegram no elementary OS, edite o arquivo '~/.local/share/applications/telegramdesktop.desktop' e substitua a seguinte linha:

Exec=/home/[seu_usuario]/Telegram/Telegram -- %u

Por:

Exec=env QT_IM_MODULE=xim /home/[seu_usuario]/Telegram/Telegram -- %u