This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/ksh | |
| # Script to initialize necessary variables to run Oracle 12c - J.K. 01/10/16 | |
| # | |
| B=`/usr/bin/tput smso` | |
| OB=`/usr/bin/tput rmso` | |
| ORACLE_SID=NSU12 | |
| ORACLE_HOME=/u01/app/oracle/product/19.0.0/client_1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " VIM user interface | |
| """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| " Set 7 lines to the curors - when moving vertical.. | |
| set so=4 | |
| set ruler "Always show current position | |
| set cmdheight=1 "The commandbar height | |
| " Set backspace config | |
| set backspace=eol,start,indent | |
| set whichwrap+=<,>,h,l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "title": "Citrix Receiver/Workspace shenanigans", | |
| "rules": [ | |
| { | |
| "description": "In Citrix, change left_option to Alt key via \"⌘⌥ Command (left)-Option\"", | |
| "manipulators": [ | |
| { | |
| "from": { | |
| "key_code": "left_option", | |
| "modifiers": { "optional": [ "any" ] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub FindReplaceinChart() | |
| Dim mySrs As Series | |
| Dim iPts As Long | |
| Dim iSrs As Long | |
| Dim aLAbel As DataLabel | |
| Dim sFormula As String | |
| If ActiveChart Is Nothing Then | |
| MsgBox "Select a chart and try again.", vbExclamation, "No Chart Selected" | |
| Else | |
| Dim old_ As String, new_ As String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| rem CPU load by process (e.g. python*) | |
| echo "Python processes % Processor Time" | |
| typeperf "\Process(python*)\% Processor Time" -sc 10 | grep / | sed -r 's/.*:(.*)/\1/g' | sed -r 's/[\",]+/ /g' | |
| rem Total CPU Load | |
| echo "Total CPU Load %" | |
| @for /f %p in ('wmic cpu get loadpercentage ^| grep -P \d+') do @echo %p% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # add to settings.py | |
| LOGGING = { | |
| 'version': 1, | |
| 'disable_existing_loggers': True, | |
| 'loggers': { | |
| 'django.db.backends': { | |
| 'handlers': ['console_sql'], | |
| 'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO').upper(), | |
| }, | |
| 'cache': { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\projects\fundraiser fundraiser λ python manage.py shell | |
| Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32 | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| (InteractiveConsole) | |
| >>> from fundraising.models import * | |
| >>> from django.db.models.sql.constants import LOUTER | |
| >>> from django.db.models import * | |
| >>> donations = Donation.objects.values('week').annotate(agg=Sum('amount')).filter(membership__group__id=OuterRef('membership__group_id')) | |
| >>> groups = Group.objects.annotate(amounts=Subquery(donations, join=True, join_type=LOUTER)) | |
| >>> groups |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Option Explicit | |
| Sub InterpolateFontColor() | |
| Dim rng As Range, lowpointColor As Long, highpointColor As Long, midpointColor As Long | |
| 'Get A Cell Address From The User to Get Number Format From | |
| On Error Resume Next | |
| Set rng = Application.InputBox( _ | |
| Title:="Interpolate Font Color in Cells", _ | |
| Prompt:="Select cell range to interpolate", _ | |
| Type:=8) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- What I have | |
| -- >>> from django.db.models.expressions import * | |
| -- >>> from foo.utils import GroupConcat | |
| -- GroupConcat is essentially just a string aggregator... code is here if you're curious https://dpaste.org/Twpu/slim#L15,20 | |
| -- >>> window = {'partition_by': [F('id'),], 'order_by': [F('workload__submission__employee__role__level').desc(),], 'frame': RowRange()} | |
| -- >>> Project.objects.annotate(team=Window(expression=GroupConcat('workload__submission__employee__goes_by'), **window)) | |
| SELECT | |
| "staffing_project"."id", | |
| "staffing_project"."name", |