Skip to content

Instantly share code, notes, and snippets.

View ferronrsmith's full-sized avatar
⛱️
Chilling on the beach

Ferron H ferronrsmith

⛱️
Chilling on the beach
View GitHub Profile
@ferronrsmith
ferronrsmith / docsets.json
Last active December 20, 2023 00:49
zeal docset
[
{
"name": "ActionScript",
"title": "ActionScript",
"sourceId": "com.kapeli.dash",
"revision": "27",
"versions": [
"3"
],
"icon": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABwElEQVR42pyTv07bUBTGf8dOAg1xSqmSAaSCMhGEHJkFCcTABKi4khkQL8AD8AY8AhMDQ4UYGJh4gbAhMTlAVXaQYEBQSqwEJXJzOrgyiTAt6pnu+XO/e77z3SOqSkVE+Q87U5VURUS/JiQrDw+kBgdj/8JxeDo97a0RUSMJ2ZieRiyrJybz84ldJALkFhYwTbMn9sHzkLcAGEB+ZeVFoeU4UCq9oYOpKYbKZQA6jQbtqysABnI5sq77b4Ah1yWdyQBwf3DA9eZmnHu/tvbiQq8vgqyuxu7t1hY/9vfpNJsAfHQcdHT0dQCzXObTxAQA7ctLns7PodUiODkBINPXx7vFxdcB8ktL8fluby+e+u3OzrNCngciCQDpNHheNLwgINjexgIEqB8e0mk0ACjMzSFdasQA5vg4pdlZAJqPj5wND/NtZgYtFKDVon50BEB/Nkuui4bBn1e6JRoYGeHL8TGfq1Wy6+sRjd3dOJ9y3WcaNqhvWXrj+5pkN76vNdBaPq+/gkBVVcMw1FqxqDZEuyAbGxRtO/GvF22b+tgYPw2D+2o1omuahMvLkfKqyqSImn9Z2zagQLpraCHwXVV+DwDt+Z4JbwqWpAAAAABJRU5ErkJggg==",
@ferronrsmith
ferronrsmith / querysets.md
Created October 8, 2023 19:53 — forked from onlyphantom/querysets.md
QuerySet API Reference (with code examples)

QuerySet API reference (stock portfolio example)

An in-depth guide to Django QuerySet (Django 3.0, updated June 2020).

When QuerySets are evaluated

Internally, a QuerySet can be constructed, filtered, sliced, and generally passed around without actually hitting the database. No database activity actually occurs until you do something to evaluate the queryset. Examples of that "something" that cause a QuerySet to evaluate:

  1. Iteration: QuerySet executes its database query the first time you iterate over it
    for q in Quote.objects.all():
        print(q.symbol)
@ferronrsmith
ferronrsmith / crack_navicat.sh
Created September 30, 2023 22:43 — forked from Archaeoraptor/crack_navicat.sh
用于Archlinux的Navicat Premium 15 破解安装脚本,已经废弃,请谨慎使用,请自行承担任何后果
#!/bin/bash
set -xeuo pipefail
echo "Crack Navicat15, works on Arch based Distro....."
echo "安装破解的一切后果请自行承担"
echo "由于版权原因本脚本不再维护,推荐使用DBeaver等开源替代或使用mycli、pgcli等终端工具,或使用教育邮箱或开源贡献认证申请Jetbrains家的DataGrip"
source /etc/os-release
case $ID in
arch)
https://file.io/qNXKi0mxGk77
@ferronrsmith
ferronrsmith / runserver.py
Created September 11, 2023 04:41 — forked from piotrkilczuk/runserver.py
Run multiple instances of Django development server using subprocesses
#!/usr/bin/env python
import glob
import os.path
import socket
import subprocess
import sys
# manage.py must be made executable in order for this to work
@ferronrsmith
ferronrsmith / LICENSE.txt
Created July 11, 2023 06:13 — forked from chrisevans/LICENSE.txt
tofu: tiny templating engine
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Haochi Chen <http://ihaochi.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@ferronrsmith
ferronrsmith / php_install.sh
Last active June 16, 2023 18:32
php_install.sh
#!/bin/sh
#
# PHP 5.6 and older require OpenSSL 1.0.2, which is too old for most modern
# operating systems. This script downloads, builds and installs OpenSSL 1.0.2
# for use in PHP builds.
#
set -ex
BUILD_DIR=/tmp/openssl-1.1.1-build
@ferronrsmith
ferronrsmith / prim_second.md
Created April 6, 2023 23:49 — forked from softwaredoug/prim_second.md
Additive vs Multiplicative Boosting Solr & Elasticsearch

Ramblings for Relevant Search. Primary and Secondary ranking factors in relevance. Problem: you want to rank with two factors. Simply multiplying scores ignores the relative significance of the primary/secondary scores. For example, in the tables below, if the first column is much more important to ranking than the second factor. The second factor is more of a tie breaker for ties in the primary criteria. Additive boosting seems to do a better job at this:

Additive Boosting

Primary Secondary Sum
10 0.9 10.9
10.1 0.7 10.8
10 0.8 10.8
@ferronrsmith
ferronrsmith / compare_solr_boosts.py
Created April 6, 2023 23:36 — forked from nolanlawson/compare_solr_boosts.py
Script for comparing the different ways of "boosting" queries in Solr
#!/bin/sh/env python
#
# Simple script for comparing the various ways of "boosting" queries in Solr,
# combined with the three main query parsers (lucene, dismax, and edismax).
# The idea is to generate md5sums of the search results, so I can quickly
# figure out which boost methods work the same as the other ones.
#
import re, urllib2, urllib, md5, json
// Refrence http://stackoverflow.com/questions/18817336/golang-encrypting-a-string-with-aes-and-base64
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"errors"
"fmt"