Skip to content

Instantly share code, notes, and snippets.

@JMichaelTX
JMichaelTX / Copy & Get Selection to Clipboard JXA.js
Last active January 2, 2023 19:32
Copy & Get Selection to Clipboard using JavaScript for Automation (JXA) [Ver 1.1.1]
'use strict';
var app = Application.currentApplication()
app.includeStandardAdditions = true
var mySelection = copySelection("Safari", 1)
mySelection
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function copySelection(pAppName, pTimeLimitSec) {
@JMichaelTX
JMichaelTX / 1 Mods to AppleScript formatICUDate by JMichaelTX.md
Last active October 8, 2021 18:48 — forked from ccstone/Create date-string using ICU Date-Time Format Syntax.applescript
AppleScript (ASObjC) Format Date/Time Using ISO/ICU Format Codes

MODS BY JMichaelTX on Sat, Feb 27, 2016

AppleScript Handler: on formatDate(pDate, pFormat)

  1. Changed record-style parameters to single-field parameters
  2. Added block to handle date parameter as a string, including International format (YYYY-MM-DD)
  3. Added handler/function: convertIntlDate(pDateStr)
var preventMultipleInstances = function(window) {
var socket = (process.platform === 'win32') ? '\\\\.\\pipe\\myapp-sock' : path.join(os.tmpdir(), 'myapp.sock');
net.connect({path: socket}, function () {
var errorMessage = 'Another instance of ' + pjson.productName + ' is already running. Only one instance of the app can be open at a time.'
dialog.showMessageBox(window, {'type': 'error', message: errorMessage, buttons: ['OK']}, function() {
window.destroy()
})
}).on('error', function (err) {
if (process.platform !== 'win32') {
// try to unlink older socket if it exists, if it doesn't,
@dbaeck
dbaeck / lumen_in_subfolder.md
Created May 6, 2015 10:25
Howto deploy Lumen projects within a subfolder (on a shared hoster)

Howto deploy Lumen projects within a subfolder (on a shared hoster)

For Lumen (5.0.8) (Laravel Components 5.0.*)

Use Case: Deploying Lumen App to Shared Hoster such that it can be called via domain.tld/lumenapp/...

Folder Layout

  • Rename public to desired name (new root folder, for example lumenapp)
  • Move everything else into a new folder, named e.g. project_src
@hofmannsven
hofmannsven / README.md
Last active March 24, 2023 08:33
My simple AngularJS Cheatsheet
@apollolm
apollolm / nginx-ssl-config
Last active January 12, 2023 14:47
Nginx Configuration with multiple port apps on same domain, with SSL.
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_geoforce {
server 127.0.0.1:3000;
}
upstream app_pcodes{
server 127.0.0.1:3001;
}
@koomai
koomai / PhpStorm Keyboard Shortcuts.md
Last active October 13, 2023 00:11
Frequently Used PhpStorm Keyboard Shortcuts

Note: Some of these shortcuts have been remapped for my own convenience (Preferences->Keymap). These are Mac shortcuts, just use the Windows/Linux equivalent of the Cmd/Option/Ctrl/Del keys.

####Search, Go to, Navigation ####

Cmd + P - Search file

Cmd + Shift + O - Search everywhere

(I swapped the above two recently because I use Cmd + P to search for files most of the time).

@lukaswhite
lukaswhite / ClearBeanstalkdQueueCommand.php
Last active March 20, 2023 08:11
Clear a Beanstalkd Queue in Laravel
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class ClearBeanstalkdQueueCommand extends Command {
/**
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 3, 2024 12:59
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@Landish
Landish / How to use?
Last active December 26, 2015 01:19
Laravel 4 Custom Facades
1) Copy the /MyNameSpace/ folder in your /app/libraries/ directory
2) Create below listed files in /app/libraries/MyNameSpace/ directory and write your code.
3) Add "app/libraries" to autoload classmap object in composer.json file
4) Run "composer dump-autoload" command with your CLI.
5) Add Route::get('test', function() { return Myclass::myMethod(); }); closure function to your app/routes.php file.
6) Visit to page http://laravel/index.php/test and see the code in action.