Skip to content

Instantly share code, notes, and snippets.

@nicocrm
nicocrm / SlxRwEl.cs
Created October 15, 2021 05:00
Static class containing utilities to decrypt strings encrypted with the SLX RW EL
/// <summary>
/// Static class containing utilities to decrypt strings encrypted with the SLX RW EL
/// </summary>
public class SlxRwEl
{
/// <summary>
/// Decode the specified data.
/// </summary>
/// <param name="data"></param>
<?php
// Execute with php -S 0.0.0.0:3000 to serve API
// And point the client to http://localhost:3000/cors-proxy.php/api
//
$path = $_SERVER['PATH_INFO'];
$base_url = MY_BASE_URL;
$url = $base_url . $path;
if(isset($_SERVER["QUERY_STRING"])) {
$url = $url . '?' . $_SERVER["QUERY_STRING"];
#set($stringObjectName = "${pagegenerator.FormName}${qfcontrol.ControlId}_Strings")
## -----------Column and Grid macros -----------------------------------------------
#macro(doDefaultColParts $col)
field: '$col.DataField',
#if($col.TextFormatString != "")
displayFields: ['$col.DataField'],
displayFormatString: ${stringObjectName}['$generator.ConvertResourceKeyToScriptReference($col.getColResourceKey("FormatString"))'] || '$col.TextFormatString',
#end
#doHideCondition($col)
label: ${stringObjectName}['$generator.ConvertResourceKeyToScriptReference($col.getColResourceKey("ColumnHeading"))'] || '$col.ColumnHeading',
@nicocrm
nicocrm / switchByProp.js
Last active March 26, 2018 21:43
transitionProps - a HOC to help build transitions with react-transition-group v2. Very nice with styled-components.
// build a switch function that examines a key/value collection based on an object literal,
// and return the first match
//
// Example usage:
// ```
// const result = switchBy({
// entering: 'A',
// entered: 'B',
// default: 'C'
// })(props)
@nicocrm
nicocrm / CrossOriginSupportModule.cs
Last active April 20, 2017 12:13 — forked from mmorton/CrossOriginSupportModule.cs
An IHttpModule for Enabling CORS
using System;
using System.Web;
namespace SSSWorld.CorsHelper
{
public class CrossOriginSupportModule : IHttpModule
{
public const string Options = "OPTIONS";
public const string Origin = "Origin";
public const string AccessControlRequestMethod = "Access-Control-Request-Method";
@nicocrm
nicocrm / xkb-colemak.xkb
Created March 14, 2017 11:49
xkbcomp map, for colemak layout, with the addition of the special layers accessible with Caps Lock, and accented (French) layer with Right Alt
// xkbcomp map, for colemak layout
// - with the addition of the special layers accessible with Caps Lock,
// - and accented (French) layer with Right Alt
xkb_keymap {
xkb_keycodes "evdev+aliases(qwerty)" {
minimum = 8;
maximum = 255;
<ESC> = 9;
<AE01> = 10;
@nicocrm
nicocrm / spinner.css
Created May 6, 2016 12:04
CSS spinner
/* Loading spinner in dashboard widgets */
@keyframes circles-loader {
0% {
transform: rotate(-720deg);
}
50% {
transform: rotate(720deg);
}
}
!
! xmodmap for the Colemak layout.
! 2006-01-01 Shai Coleman, http://colemak.com/ . Public domain.
keycode 49 = grave asciitilde dead_tilde asciitilde
keycode 10 = 1 exclam exclam onesuperior
keycode 11 = 2 at masculine twosuperior
keycode 12 = 3 numbersign ordfeminine threesuperior
keycode 13 = 4 dollar cent sterling
keycode 14 = 5 percent EuroSign yen
@nicocrm
nicocrm / AutoHotkey.ahk
Last active May 10, 2016 17:58
Use caps as modifier, remapping letter keys to symbols
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
#SingleInstance force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CapsLock & q:: Send, {\}
CapsLock & w:: Send, {=}
CapsLock & f:: Send, {[}
CapsLock & p:: Send, {]}
@nicocrm
nicocrm / ajaxLink.js
Created April 3, 2016 19:30
Ajaxify links