Skip to content

Instantly share code, notes, and snippets.

@abixalmon
abixalmon / jquery add & remove table rows
Created April 7, 2014 09:59
jQuery function to add and remove table row. Works with a form attached.
<table class="table table-striped table-bordered" id="form_fields_data">
<thead>
<tr>
<th>Key</th>
<th>Value</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
@abixalmon
abixalmon / avistaz_bonus.php
Last active January 11, 2025 21:54
AvistaZ bonus point formula
<?php
if (count($bonus_users)) {
foreach ($bonus_users as $user_id => $bonus_user) {
$torrents = count($bonus_user['torrents']);
if ($torrents < 10) {
$bonus = max(0.1, (0.05 * $torrents));
} else {
$bonus = min(2, 1 + (0.01 * $torrents));
}
#!/usr/bin/env bash
$CLIENTID="YOUR_CLIENT_ID"
function reload_tor() {
echo "Reloading Tor"
service tor reload
sleep $[ ( $RANDOM % 5 ) + 20 ]
}
@abixalmon
abixalmon / composer.json
Created August 25, 2018 17:21
flarum composer.json for php 7.2
{
"name": "flarum/flarum",
"description": "Delightfully simple forum software.",
"type": "project",
"keywords": ["forum", "discussion"],
"homepage": "http://flarum.org",
"license": "MIT",
"authors": [
{
"name": "Toby Zerner",