Skip to content

Instantly share code, notes, and snippets.

@threez
threez / update_keystore_ldap.sh
Created March 3, 2014 10:20
Extract and update a ldap certificate in a java keystore (jenkins)
#!/bin/bash
LDAP_SERVER=example.com:636
ALIAS=LDAP_SERVER
KEYSTORE=/usr/lib/jvm/java-1.6.0-openjdk-amd64/jre/lib/security/cacerts
PASSWD=changeit
# grep the certificate
echo -n | openssl s_client -connect $LDAP_SERVER | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ldaps.crt
<?php
declare(strict_types=1);
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\math\VoxelRayTrace;
use pocketmine\player\Player;
use pocketmine\scheduler\CancelTaskException;
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 24, 2024 11:51
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@BitPhinix
BitPhinix / binding.tsx
Last active April 24, 2024 11:49
yjs react binding
import React, { useMemo, useSyncExternalStore } from "react";
import {
type SharedArray,
type SharedDoc,
type SharedMap,
type SharedType,
type ToJson,
type ToJsonDeep,
} from "./types.ts";
@rysstad
rysstad / Install-MSIPackage.ps1
Last active April 24, 2024 11:49
Install MSI package silently with powershell
$msiPackageToInstall = "<path to .msi>"
# save log from installation to temp file
$tmpFile = [System.IO.Path]::GetTempFileName()
Start-Process msiexec -ArgumentList "/i $msiPackageToInstall /qn /L*v $tmpFile" -NoNewWindow -Wait
@AruniRC
AruniRC / ms_coco_classnames.txt
Created March 5, 2018 20:37
Class Names of MS-COCO classes in order of Detectron dict
{0: u'__background__',
1: u'person',
2: u'bicycle',
3: u'car',
4: u'motorcycle',
5: u'airplane',
6: u'bus',
7: u'train',
8: u'truck',
9: u'boat',
@ddanier
ddanier / fastapi_globals.py
Last active April 24, 2024 11:46
flask.g for FastAPI.
"""
This allows to use global variables inside the FastAPI application using async mode.
# Usage
Just import `g` and then access (set/get) attributes of it:
```python
from your_project.globals import g
@CreatureSurvive
CreatureSurvive / iOS System Colors.md
Created March 21, 2022 21:51
iOS System Colors with their light and dark values

iOS System Colors

Background Colors

Color Name Light Color Dark Color
systemBackground #FFFFFFFF rgba(1.0, 1.0, 1.0, 1.0) #000000FF rgba(0.0, 0.0, 0.0, 1.0)
secondarySystemBackground #F2F2F7FF rgba(0.95, 0.95, 0.97, 1.0) #1C1C1EFF rgba(0.11, 0.11, 0.12, 1.0)
tertiarySystemBackground #F2F2F7FF rgba(0.95, 0.95, 0.97, 1.0) #1C1C1EFF rgba(0.11, 0.11, 0.12, 1.0)
tertiarySystemBackground #FFFFFFFF rgba(1.0, 1.0, 1.0, 1.0) #2C2C2EFF rgba(0.17, 0.17, 0.18, 1.0)
jQuery(document).ready(function($) {
// Start ready block
// if ($.fn.datetimepicker) {
// $('#incident_date_time').datetimepicker({
// format: 'Y-m-d H:i',
// step: 5
// });
// }