Skip to content

Instantly share code, notes, and snippets.

View groovyghoul's full-sized avatar

Richard O'Neil groovyghoul

View GitHub Profile

How to install Lua and LuaJIT on 64-bit Windows

  1. Download the latest Lua and LuaJIT sources

    • Create temporary folder for Lua sources.
      I assume you would use C:\Temp\ folder.

    • Visit Lua FTP webpage and download the latest Lua source archive, currently it is lua-5.4.3.tar.gz

  • Use suitable software (7-Zip, WinRar, WinZip or TotalCommander) to unpack the archive.
@groovyghoul
groovyghoul / gist:30bf4797587b9eeecbd96306ffac2f55
Created March 26, 2023 00:03
Git: How to squash all commits, reset history on main branch ( 1 clean commit on master)
```
git commit-tree HEAD^{tree} -m "new base commit message"
```
copy the SHA
```
git reset [SHA]
git push origin -f main
```
@groovyghoul
groovyghoul / mongo_rs_create.sh
Last active March 25, 2016 04:03
Spin up 3 Docker containers with MongoDb replicaSet
#!/bin/bash
mkdir -p ~/mongodb/data
# Define Hostnames
h1="bytemares1"
h2="bytemares2"
h3="bytemares3"
# Start containers with specific hostnames and replica set name
docker run -d -P -p 33331:27017 --name bytemares1 -v ~/mongodb/data:/data/db --hostname="$h1" mongo mongod --replSet rset --noprealloc --smallfiles
@groovyghoul
groovyghoul / CookieTestController.cs
Created March 21, 2016 12:14
ASP.Net MVC set/get cookie
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Microsoft.Ajax.Utilities;
using Newtonsoft.Json;
namespace cookies.Controllers
{
@groovyghoul
groovyghoul / gist:c46e220395e7b9e62e5c
Last active August 29, 2015 14:08
Roll through Xml elements
Add `System.Runtime.Serialization` to the using clauses
public static object Deserialize(string path)
{
using (var sr = new FileStream(path, FileMode.Open))
{
creditBureau p = null;
XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(sr, new XmlDictionaryReaderQuotas());
var serializer = new DataContractSerializer(typeof(creditBureau));

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@groovyghoul
groovyghoul / gist:2ceed07e31914bf6e647
Created September 10, 2014 19:10
Interbase active connections
select a.TMP$STATE, a.TMP$USER, a.TMP$USER_IP_ADDR, a.TMP$USER_HOST, a.TMP$USER_PROCESS
from TMP$DATABASE d join TMP$ATTACHMENTS a on d.TMP$DATABASE_ID = a.TMP$DATABASE_ID
@groovyghoul
groovyghoul / gist:2924908
Created June 13, 2012 15:48
Sending email with attachment and credentials
using System;
using System.Net.Mail;
using System.Windows.Forms;
namespace TestingMail
{
public partial class Form1 : Form
{
public Form1()
{
@groovyghoul
groovyghoul / gist:2903492
Created June 10, 2012 01:50
Silverlight web.config
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".xaml" mimeType="application/xaml+xml" />
<mimeMap fileExtension=".xap" mimeType="application/x-silverlight-app" />
<mimeMap fileExtension=".xbap" mimeType="application/x-ms-xbap" />
</staticContent>
</system.webServer>
</configuration>
@groovyghoul
groovyghoul / RegExCollection.txt
Created November 22, 2011 00:53
My RegEx Collection
Interbase connection string
([^:]*)(:)(.+)
Example:
localhost:d:\ais\ins.ib
$1 = localhost
$3 = d:\ais\ins.ib