Skip to content

Instantly share code, notes, and snippets.

View rinogo's full-sized avatar

Rich Christiansen rinogo

  • Social5
  • Utah, USA
View GitHub Profile
@msteen
msteen / print-lezer-tree.ts
Last active May 1, 2024 21:05
Print Lezer Trees
// MIT License
//
// Copyright (c) 2021 Matthijs Steen
//
// 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
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@motin
motin / commit-using-commitizen-in-new-iterm-window.scpt
Last active January 10, 2023 18:57
Add as SourceTree custom action: Open in Seperate Window (checked), Script to run `/path/to/commit-using-commitizen-in-new-iterm-window.sh` (this path MUST NOT contain spaces due to long-standing SourceTree bug https://jira.atlassian.com/browse/SRCTREE-2150), Parameters: `$REPO`
on run argv
set repoPath to (item 1 of argv)
tell application "iTerm"
set newWindow to (create window with default profile)
tell current session of newWindow
write text "cd " & quoted form of repoPath & " && npx git-cz"
end tell
end tell
end run
@Cybso
Cybso / sort-access-log
Last active April 11, 2024 11:10
Sort apache access logs and convert 'common' into 'combined'. The output of this script can be used as input for awffull or webalizer.
#!/bin/bash
###
# Sorts the rows of one or multiple apache access_log files
# by date (ascending) and converts them from 'common' log format
# into 'combined' (if you switched the log file format meanwhile).
#
# This is useful when you want to merge multiple log files, e.g. when
# you have different files for HTTP and HTTPS.
#
# Usage:
@bladeSk
bladeSk / SQLite-PHP-quickstart.php
Last active November 5, 2024 01:48
SQLite3 PHP Quickstart Tutorial
<?php
// This file walks you through the most common features of PHP's SQLite3 API.
// The code is runnable in its entirety and results in an `analytics.sqlite` file.
// Create a new database, if the file doesn't exist and open it for reading/writing.
// The extension of the file is arbitrary.
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
// Errors are emitted as warnings by default, enable proper error handling.
// Usage:
// OfflineListener.init(true);
define(['angular', 'core'], function(angular){
// Some concepts from: https://github.com/HubSpot/offline
var module = angular.module('utils.offline', []);
module.service('OfflineListener', function ($rootScope, $window, $alert) {
var offlineAlert;