Skip to content

Instantly share code, notes, and snippets.

@yurijserrano
yurijserrano / new_solution.sql
Created May 6, 2024 05:45
Challenges - Second Exercise Solution
UPDATE vehicles SET registration_date = CURRENT_DATE - INTERVAL '11 months' WHERE id = 1;
UPDATE vehicles SET registration_date = CURRENT_DATE - INTERVAL '12 months' WHERE id = 2;
UPDATE vehicles SET registration_date = CURRENT_DATE - INTERVAL '18 months' WHERE id = 3;
UPDATE vehicles SET registration_date = CURRENT_DATE - INTERVAL '20 months' WHERE id = 4;
SELECT d.first_name, d.last_name, v.make, v.model, v.registration_date
FROM drivers d
JOIN vehicles v ON d.id = v.driver_id
WHERE v.registration_date = CURRENT_DATE - INTERVAL '11 months';
-----BEGIN PUBLIC KEY-----
MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgHMXkzWFVQyC5GshvpsjKn7QLLEs
TVikt16nNJQs8MQfs/m9rLgJNBVwAab18+DtyqmmbPhIPb4FSJM30yARgdn4GHHE
2Wmt7TWI3UrrQsNoTUY9PFs2VlxRfNAQ2LDrpwG8VTodKQvTwCzx6qopf6lgxGFk
Sa4VZhKtxceao40LAgMBAAE=
-----END PUBLIC KEY-----
@thegamecracks
thegamecracks / wrap_label.py
Created May 6, 2024 05:43
A tkinter label with automatic text wrapping
import sys
from tkinter import Event, Tk
from tkinter.ttk import Frame, Label
if sys.platform == "win32":
from ctypes import windll
windll.shcore.SetProcessDpiAwareness(2)
LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce malesuada ipsum enim, feugiat venenatis sapien tempus et. Morbi auctor egestas metus vel faucibus. Nullam in nunc nisi. Maecenas eget sagittis ante. Sed ut turpis turpis. Morbi suscipit massa ac efficitur iaculis. Suspendisse risus nisi, tempor non pulvinar sed, vehicula a sapien. Pellentesque iaculis ligula sed sapien faucibus, eget mollis magna volutpat. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Morbi porttitor luctus tellus, nec tincidunt lacus. Nunc dui eros, laoreet sed pretium id, porttitor eget nunc."
@choco-bot
choco-bot / Install.txt
Created May 6, 2024 05:43
visioviewer v16.0 - Passed - Package Tests Results
2024-05-06 05:42:20,232 4172 [DEBUG] - XmlConfiguration is now operational
2024-05-06 05:42:20,390 4172 [DEBUG] - Adding new type 'CygwinService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2024-05-06 05:42:20,402 4172 [DEBUG] - Adding new type 'CygwinService' for type 'IInstallSourceRunner' from assembly 'choco'
2024-05-06 05:42:20,402 4172 [DEBUG] - Adding new type 'PythonService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2024-05-06 05:42:20,402 4172 [DEBUG] - Adding new type 'PythonService' for type 'IListSourceRunner' from assembly 'choco'
2024-05-06 05:42:20,402 4172 [DEBUG] - Adding new type 'PythonService' for type 'IInstallSourceRunner' from assembly 'choco'
2024-05-06 05:42:20,420 4172 [DEBUG] - Adding new type 'PythonService' for type 'IUninstallSourceRunner' from assembly 'choco'
2024-05-06 05:42:20,420 4172 [DEBUG] - Adding new type 'RubyGemsService' for type 'IAlternativeSourceRunner' from assembly 'choco'
2024-05-06 05:42:20,420 4172 [DEBUG] - Adding new typ
port: 7890
socks-port: 7891
allow-lan: true
mode: Rule
log-level: info
external-controller: 127.0.0.1:9090
proxies:
- name: MM01
type: socks5
server: 106.75.152.119
@prognostikos
prognostikos / logs_elapsed_time.rb
Created May 6, 2024 05:42
A Rails initializer to replace the asset host baked into images with the current ASSET_HOST environment variable
module LogsElapsedTime
def logs_elapsed_time(log_prefix, &block)
starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
block.call
ending = Process.clock_gettime(Process::CLOCK_MONOTONIC)
$stdout.puts "#{log_prefix} elapsed_time=#{ending - starting}"
end
@nopresnik
nopresnik / query.sql
Created May 6, 2024 05:42
B2B redemption report
SELECT o.Name, u.EmailAddress, u.FirstName, u.LastName, u.Status, u.CreatedAt
FROM User u
LEFT JOIN Organisation_User ou ON u.Id = ou.UserId
LEFT JOIN Organisation o ON ou.OrganisationId = o.Id
WHERE ou.OrganisationId = 'RbVYBJSsqsRksbHC'
AND u.Password IS NULL

Keybase proof

I hereby claim:

  • I am narthanaj on github.
  • I am narthanaj (https://keybase.io/narthanaj) on keybase.
  • I have a public key ASB9JJcYCMEX_sPFepaNkAO54oGoOlNonWy-SdVzBekbfwo

To claim this, I am signing this object:

@choco-bot
choco-bot / 1.RegistrySnapshot.xml
Created May 6, 2024 05:41
MsSqlServerManagementStudio2014Express v12.2.5000.20170905 - Failed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<registrySnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<user>S-1-5-21-2036257567-922958934-123839789-1000</user>
<keys>
<key installerType="Unknown" displayName="Microsoft Help Viewer 1.1" displayVersion="1.1.40219">
<RegistryView>Registry64</RegistryView>
<KeyPath>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Help Viewer 1.1</KeyPath>
<DefaultValue />
<InstallLocation><![CDATA[C:\Program Files\Microsoft Help Viewer\v1.0\]]></InstallLocation>
<UninstallString><![CDATA[C:\Program Files\Microsoft Help Viewer\v1.0\Microsoft Help Viewer 1.1\install.exe]]></UninstallString>
[11:10:51 上午]
[Firebase] - SubscribeSignal
FirebaseMessagingHandler:SubscribeSignal()
-----------------------------------------------
[11:10:51 上午]