Skip to content

Instantly share code, notes, and snippets.

@Kalyse
Kalyse / copy-to-clipboard-bookmarklet.md
Created March 27, 2020 13:26 — forked from stefanmaric/copy-to-clipboard-bookmarklet.md
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard

Copy-to-clipboard Bookmarklet

Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.

This is the base javascript:

(function (text) {
  var node = document.createElement('textarea')
  var selection = document.getSelection()
@Kalyse
Kalyse / DiscriminatorEntry.php
Created October 5, 2016 15:56 — forked from Berbass/DiscriminatorEntry.php
Had some issues with the original version on this gist https://gist.github.com/jasperkuperus/03302fefe6e4722ab650 , so I made some changes. This code also works if using abstract MappedSuperClass.
<?php
namespace Namespace\That\Suits\You;
/**
* @Annotation
* @Target("CLASS")
*/
class DiscriminatorEntry implements \Doctrine\ORM\Mapping\Annotation
{
$( "#submit" ).click(
function() {
$( "#submit" ).addClass("disabled");
setTimeout( function(){ $( "#submit" ).removeClass("disabled"); }, 5000);
});
require(['IgnoreModule!module/to/Ingore'], function (Ignore) {...});
@Kalyse
Kalyse / Monokai-FannonEdition.tmTheme
Last active December 15, 2015 13:28 — forked from Fannon/Monokai-FannonEdition.tmTheme
Updating for more soft background color
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai FannonEd</string>
<key>settings</key>
<array>
<dict>
@Kalyse
Kalyse / pingfcgi.sh
Created October 3, 2012 13:27 — forked from mpasternacki/pingfcgi.sh
Ping FCGI server, using cgi-fcgi program from libfcgi library.
#!/bin/sh
set -e
# Ping FCGI server. Uses cgi-fcgi program from libfcgi library.
# Retrieves the root path (/) from host:port specified on command line.
if [ -z "$1" ] ; then
echo "Usage: $0 host:port|path/to/socket" >&2
exit 1
fi
# This module intentionally minimizes dependencies to mitigate breakage risk.
# Subset of Syslog's numerical severity codes (RFC 3164, Table 2)
SEVERITY =
ERROR: 3
WARN: 4
INFO: 6
DEBUG: 7
# Configuration