Skip to content

Instantly share code, notes, and snippets.

@ProGM
ProGM / DataTable.svelte
Created December 21, 2021 20:22
Sample svelte data table implementation
<script context="module" lang="ts">
import type { SvelteComponent } from 'svelte';
export interface ColumnConfig {
sortable?: boolean;
sort?: string;
name: string;
class?: string;
default?: string;
label: string;
@ProGM
ProGM / connection.lua
Last active April 5, 2021 07:01
A simple connection checker for Corona SDK
---------------------------------------
-- Test connection to the internet
---------------------------------------
local socket = require("socket")
local connection = {}
local function manual_test(callback, timeout)
if timeout == nil then timeout = 1000 end
local connection = assert(socket.tcp())
connection:settimeout(0)
<?xml version="1.0" encoding="UTF-8"?>
<document>
<steps>
<wait>5</wait>
<press>SkipIntro</press>
<wait>3</wait>
<press>Menu/Settings</press>
<wait>3</wait>
<press>SettingsTab/Options</press>
@ProGM
ProGM / delete_files_recursively.sh
Last active March 6, 2019 08:18
Delete files from a google drive folder via command line
# Delete all files in the drive folder, excluding google docs
find . -type f \( ! -iname "*.gdoc" -and ! -iname "*.html" -and ! -iname "*.gsheet" -and ! -iname "*.gdraw" -and ! -iname "*.gslides" -and ! -iname "*.gform" -and ! -iname "*.gtable" -and ! -iname Icon\? \) -delete
@ProGM
ProGM / diff_folders.sh
Created March 6, 2019 06:33
Check differences between two folders in bash
#!/usr/bin/env bash
tmpfile1=$(mktemp /tmp/report.XXXXXX)
tmpfile2=$(mktemp /tmp/report2.XXXXXX)
cd "$1"
find . >> $tmpfile1
cd "$2"
find . >> $tmpfile2
@ProGM
ProGM / gist:4b628044113d0b3d8d80
Created February 27, 2015 12:11
Useful shell snippets
# Delete empty folders recursively
find . -type d -empty -delete
@ProGM
ProGM / example.js
Last active September 3, 2017 17:06
Example indiexpo API implementation in Javascript
/*
* An usage example of the previous library
*/
function loadData() {
// Send score 1
indiexpo.sendScore(1).then(function(data) {
console.log('score sent, response:', data);
});
// Get current user username
@ProGM
ProGM / main.rb
Last active June 19, 2017 10:09 — forked from coorasse/main.rb
CanCanCan Issue when compiling SQL using `accessible_by`
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '5.1.1' # use correct rails version
@ProGM
ProGM / .bash_prompt
Created February 8, 2017 18:31
Customized dotfiles
# Customized dotfiles. Original credits:
# Shell prompt based on the Solarized Dark theme.
# Screenshot: http://i.imgur.com/EkEtphC.png
# Heavily inspired by @necolas’s prompt: https://github.com/necolas/dotfiles
# iTerm → Profiles → Text → use 13pt Monaco with 1.1 vertical spacing.
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM='gnome-256color';
elif infocmp xterm-256color >/dev/null 2>&1; then
@ProGM
ProGM / debug.rb
Created October 12, 2016 10:36
Debugging neo4j.rb
Neo4j::ActiveBase.current_session.adaptor.logger.level = Logger::DEBUG
Neo4j::Core::CypherSession::Adaptors::Base.subscribe_to_query(&method(:puts))
Neo4j::Core::CypherSession::Adaptors::HTTP.subscribe_to_request(&method(:puts))
Neo4j::Core::CypherSession::Adaptors::Embedded.subscribe_to_transaction(&method(:puts))