Skip to content

Instantly share code, notes, and snippets.

View aurora's full-sized avatar
🤔
...

Harald Lapp aurora

🤔
...
View GitHub Profile
@adamnew123456
adamnew123456 / curses.js
Last active December 18, 2024 11:52
A Small Javascript Library For Emulating Curses
/**
* An implementation of an API similar to ncurses, but which instead runs on
* HTMl5 canvas.
*
* Specifically, this is designed to duplicate the following elements of ncurses:
*
* - Basic text printing
* - Colors
* - Handling window hierarchies, which respect their parents bounds (so that
* drawing doesn't occur outside of a window's boundaries). They have their own
@maxivak
maxivak / 00. tutorial.md
Last active September 11, 2024 19:58
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
@jjwhitney
jjwhitney / instructions.txt
Created October 22, 2014 10:59
Recover a ZFS pool hidden on a detached device
Originally written by Jeff Bonwick (http://www.mail-archive.com/[email protected]/msg15748.html), and updated by James Lee to work with modern ZFS libs (https://www.mail-archive.com/[email protected]/msg47316.html), I was able to compile this life-saving utility in Ubuntu 14.04 and have verified that it works. (I'm using ZFSonLinux.)
Download the ZFSonLinux tarball and replace the cmd/zhack/zhack.c file with "labelfix.c". Note that zhack is just a simple utility that we're replacing so that we don't have to setup the build environment. (It's hard, so we'll reuse the good work of the ZFSonLinux people.)
Run "./configure; make" and if all goes well then the zfs tools will be built, except for zhack, which we replaced. Run that with the device path to recover your data.
If you want to be super-careful and not tamper with your disk, you can clone it and run the utility on your clone. Or, create an overlay as described in this page: https://raid.wiki.kernel.org/index.php/Recovering_a_failed_
@rherrmann
rherrmann / GitInternalsLearningTest.java
Last active October 11, 2020 07:11
'Learning Tests' that use the JGit API to explore the internals of Git commits: http://www.codeaffine.com/2014/10/20/git-internals/
/***************************************************************************************************
* Copyright (c) 2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
**************************************************************************************************/
package com.codeaffine.jgit;
@kavu
kavu / swift.sh
Last active June 20, 2017 02:58
Minimal Swift command line Hello World
#!/bin/sh
# So you've installed XCode 6 Beta
# Now we could use Swift toolchain to build a minimal
# command line Hellow World
# let's set new Developer Toolchain bundled with Xcode6-Beta.app
# as default toolchain
# sudo xcode-select -s /Applications/Xcode6-Beta.app/Contents/Developer
# alias for Swift binary
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
<?
require("redis.php");
require("json.php");
$term = $_GET['term'];
$r = new Redis("127.0.0.1","6379");
$r->connect();
$items = $r->zrangebylex("kernel","[$term","[$term\xff",Array("LIMIT","0","10"));
@mbostock
mbostock / .block
Last active January 10, 2025 23:35
Perspective Transformation
license: gpl-3.0
@yorch
yorch / ispconfig-migration.sh
Created March 7, 2014 12:39
ISPConfig 3 script to move installation from one server to another
#!/bin/bash
# Migrate ISPConfig 3 installation from one server to another
# This script should run on the final/destination ISPConfig 3 server
# You must first install the same ISPConfig on the destination server
# and make sure to create all the users from the previous installation
# (ISPConfig creates users for each client and web page)
# Tested on ISPConfig version 3.0.5.3
# Created by Jorge Barnaby (@jbarnaby) - March 2014
# EDIT YOUR PREVIOUS ISPCONFIG SERVER HERE
@aktau
aktau / imessage
Last active February 25, 2025 15:56
Send iMessage from the commandline
#!/bin/sh
if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi
exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit
-- another way of waiting until an app is running
on waitUntilRunning(appname, delaytime)
repeat until my appIsRunning(appname)
tell application "Messages" to close window 1
delay delaytime
end repeat