Skip to content

Instantly share code, notes, and snippets.

View nlharri's full-sized avatar

László Harri Németh nlharri

View GitHub Profile
@ldd
ldd / ttf-to-png.md
Created February 26, 2020 01:37
Convert ttf to png

steps

  • get a valid ttf file, or assets like this one
  • get alphabet, for example:
     const s = "";
     for(let i=0; i < 76; i++1){
     if(i % 16 === 0) s += "\n";
     s += String.fromCharCode(47 + i);

}

@valeriecodes
valeriecodes / recipes.pl
Created July 24, 2019 20:29
Experimenting with Recipes in Prolog
recipe(muffin).
recipe('chickpea soup').
recipe(tiramisu).
recipe(pancakes).
recipe(latkes).
recipe(gazpacho).
contains(blueberries, muffin).
contains(milk, muffin).
contains(butter, muffin).
@TyrfingMjolnir
TyrfingMjolnir / README.convert_iOS_icon.md
Last active February 26, 2019 06:23
Convert 1 image 2048x2048 to all needed sizes for an iOS app
@fnky
fnky / ANSI.md
Last active July 24, 2024 02:06
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@fawkesley
fawkesley / Makefile
Last active April 11, 2020 17:58
Makefile for activating a virtualenv and installing requirements. Uses requirements-to-freeze.txt / requirements.txt pattern
# Put *unversioned* requirements in `requirements-to-freeze.txt` as described below.
# `requirements.txt` will be automatically generated from `pip freeze`
# https://www.kennethreitz.org/essays/a-better-pip-workflow
venv/bin/activate: requirements-to-freeze.txt
rm -rf venv/
test -f venv/bin/activate || virtualenv -p $(shell which python3) venv
. venv/bin/activate ;\
pip install -Ur requirements-to-freeze.txt ;\
pip freeze | sort > requirements.txt
@cwalo
cwalo / RoundShadowView.swift
Created December 29, 2017 00:10
UIView with cornerRadius and Shadow
/*
Example of how to create a view that has rounded corners and a shadow.
These cannot be on the same layer because setting the corner radius requires masksToBounds = true.
When it's true, the shadow is clipped.
It's possible to add sublayers and set their path with a UIBezierPath(roundedRect...), but this becomes difficult when using AutoLayout.
Instead, we a containerView for the cornerRadius and the current view for the shadow.
All subviews should just be added and constrained to the containerView
*/
import UIKit
@monkeywithacupcake
monkeywithacupcake / CollectionViewUnicodeEmojis.playground
Created October 19, 2017 02:41
Swift 4 Playground showing how to build StackView, Horizontal CollectionView, and work with unicode emojis programmatically
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
extension String {
func getUnicodeCodePoints() -> [String] {
return unicodeScalars.map { "U+" + String($0.value, radix: 16, uppercase: true) }
}
}
@dgrtwo
dgrtwo / mnist_pairs.R
Created May 31, 2017 18:56
Comparing pairs of MNIST digits based on one pixel
library(tidyverse)
# Data is downloaded from here:
# https://www.kaggle.com/c/digit-recognizer
kaggle_data <- read_csv("~/Downloads/train.csv")
pixels_gathered <- kaggle_data %>%
mutate(instance = row_number()) %>%
gather(pixel, value, -label, -instance) %>%
extract(pixel, "pixel", "(\\d+)", convert = TRUE)
@juemura
juemura / c9-github-integration.md
Last active September 12, 2023 09:40
Tutorial: How to connect your Cloud9 and GitHub accounts via ssh

#Tutorial: How to connect your Cloud9 and GitHub accounts via ssh

To avoid having to enter your username and password EVERY-SINGLE-TIME you push, follow these step-by-step instructions.


#####1. Copy your C9 ssh key. Go to https://c9.io/account/ssh and copy the key below *"Connect to your private git repository"*. It's a very long string that starts with ssh-rsa and ends with your email.

#####2. Paste your C9 ssh key into your GitHub account

@nateve
nateve / NLTK.ipynb
Created December 16, 2016 10:22
Reproduces some of the code in http://www.nltk.org/book/, especially from chapters 1, 2, 6, and 8.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.