Skip to content

Instantly share code, notes, and snippets.

@jcppkkk
jcppkkk / OpenWithSublime.bat
Last active June 25, 2023 22:07 — forked from FoxColdMetal/OpenWithSublimeText.bat
[[[ Move to https://github.com/jcppkkk/OpenWithSublime !!! ]]] Add context menu to allow user open file or folder with Sublime as User (or as Admin).
@echo off
:: Path to Sublime Text installation dir.
SET stPath=%~dp0sublime_text.exe
SET stPathOnly=%~dp0
:: Key name for the registry entries.
SET UserEntry=Sublime Text
SET AdminEntry=Sublime Text As Admin
:: Context menu texts.
SET "UserMenuText=Open with Sublime(&-)"
SET "AdminMenuText=Open with Sublime As Admin(&+)"
@youssman
youssman / regex-camelCase-to-dash.js
Created November 5, 2014 11:19
Javascript convert camelcase to dash (hyphen)
function camelCaseToDash( myStr ) {
return myStr.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase();
}
var myStr = camelCaseToDash( 'thisString' );
alert( myStr ); // => this-string
@youssman
youssman / dash-to-camelCase.js
Created November 5, 2014 11:25
Javascript convert dash (hyphen) to camelcase
function dashToCamelCase( myStr ) {
return myStr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
}
var myStr = dashToCamelCase( 'this-string' );
alert( myStr ); // => thisString
@amccarty
amccarty / CORS config for jetty
Created July 15, 2016 17:09
CORS config for jetty
# /path/to/server/solr-webapp/webapp/WEB-INF/web.xml
<filter>
<filter-name>cross-origin</filter-name>
<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
<init-param>
<param-name>allowedOrigins</param-name>
<param-value>http://localhost*</param-value>
</init-param>
<init-param>
@churro-s
churro-s / LetsEncrypt_HTTPS_plex.MD
Last active June 28, 2024 02:49
Setup Let's Encrypt certificate for use with Plex Media Server on Ubuntu
@tech-andgar
tech-andgar / scriptFix15517.sql
Last active April 13, 2024 07:31
Fix Error 15517 SQL SERVER No se puede ejecutar como la entidad de seguridad de base de datos porque la entidad 'dbo' no existe, este tipo de entidad de seguridad no se puede suplantar o el usuario no tiene permiso.
USE [DB Name]
GO
EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false
GO
@ahmeti
ahmeti / only-number.directive.md
Last active May 7, 2024 14:54
Angular 5 - Only Number Input, Only Number Decimal
@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@stracker-phil
stracker-phil / global-search.js
Last active July 1, 2024 18:47
Recursively searches the entire object tree for a given value
/**
* Recursively searches the startObject for the given value.
*
* All matches are displayed in the browser console and stored in the global variable "gsResults"
* The function tries to simplify DOM element names by using their ID, when possible.
*
* Usage samples:
*
* globalSearch( document, 'someValue' ); // Search entire DOM document for the string value.
* globalSearch( document, '^start' ); // Simple regex search (function recognizes prefix/suffix patterns: "^..." or "...$").