Skip to content

Instantly share code, notes, and snippets.

View mhamlet's full-sized avatar

Hamlet mhamlet

View GitHub Profile
@ynagatomo
ynagatomo / RealityDump.swift
Last active October 30, 2024 20:32
A simple dump function to show the RealityKit Entity, ModelEntity, and AnchorEntity object.
// RealityDump.swift
// Created by Yasuhito NAGATOMO on 2022/02/22.
import Foundation
import RealityKit
#if DEBUG
// swiftlint:disable line_length
private let keywords = [ // (string, indentLevel [1...])
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active July 31, 2025 13:24
crack activate Office on mac with license file
@fxfactorial
fxfactorial / trie.js
Created January 25, 2017 02:26
Simple Trie implementation
var Trie = function () {
this.next = {};
this.is_word = false;
};
const code = c => c.codePointAt(0) - 'a'.codePointAt(0);
Trie.prototype.insert = function (key) {
let iter = this;
for (let c of key) {
@sawapi
sawapi / AppDelegate.swift
Last active October 25, 2023 09:26
[Swift] Push Notification
//
// AppDelegate.swift
// pushtest
//
// Created by sawapi on 2014/06/08.
// Copyright (c) 2014年 sawapi. All rights reserved.
//
// iOS8用
import UIKit
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active May 6, 2025 10:00
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@tracend
tracend / aws_ec2_root.md
Created November 5, 2012 12:02
AWS EC2: Steps to enable root access with your local key - Inspired by: https://forums.aws.amazon.com/thread.jspa?threadID=86876

Note: replace {{server}} with your domain or ip

  • Login as the ec2-user
ssh -i key.pem ec2-user@{{server}}
  • Switch to administrator
sudo -i
anonymous
anonymous / cc.py
Created December 1, 2011 10:47
Useless C subset compiler
#!/usr/bin/env python
import sys
class Lexer:
NUM, ID, IF, ELSE, WHILE, DO, LBRA, RBRA, LPAR, RPAR, PLUS, MINUS, LESS, \
EQUAL, SEMICOLON, EOF = range(16)
SYMBOLS = { '{': LBRA, '}': RBRA, '=': EQUAL, ';': SEMICOLON, '(': LPAR,
@robcowie
robcowie / tornado_socket_server.py
Created May 16, 2011 15:48
Simple example of creating a socket server with Tornado
import errno
import functools
import socket
from tornado import ioloop, iostream
class Connection(object):
def __init__(self, connection):
self.stream = iostream.IOStream(connection)
self._read()