This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# check if spotify is already running and if so just pass the uri in | |
if pgrep -f "Spotify/[0-9].[0-9].[0-9]" > /dev/null | |
then | |
busline=busline=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri $1 | |
echo "Spotify is already running" | |
echo "Sending ${busline} to dbus" | |
if command -v qdbus &> /dev/null | |
then | |
qdbus $busline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var canonicalize = function(input) { | |
if (input === null || typeof input !== 'object') { | |
///////////////////////////////////////////////// | |
// Primitive data type - Use ES6/JSON // | |
///////////////////////////////////////////////// | |
return JSON.stringify(input); | |
} else if (Array.isArray(input)) { | |
///////////////////////////////////////////////// | |
// Array - Maintain element order // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc b/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc | |
index 4995b3c75c44..a4014f0482c5 100644 | |
--- a/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc | |
+++ b/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc | |
@@ -140,39 +140,39 @@ bool RenderViewContextMenuViews::GetAcceleratorForCommandId( | |
return true; | |
case IDC_CONTENT_CONTEXT_UNDO: | |
- *accel = ui::Accelerator(ui::VKEY_Z, ui::EF_CONTROL_DOWN); | |
+ *accel = ui::Accelerator(ui::VKEY_Z, ui::EF_PLATFORM_ACCELERATOR); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your key bindings in this file to override the defaultsauto[] | |
[ | |
{ | |
"key": "meta+c", | |
"command": "editor.action.clipboardCopyAction" | |
}, | |
{ | |
"key": "meta+x", | |
"command": "editor.action.clipboardCutAction" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
require_once(getenv('PHP_LIBS_AUTOLOADER')); | |
(new \NunoMaduro\Collision\Provider)->register(); | |
class Config extends BackupManager\Config\Config | |
{ | |
public static function fromArray(array $array) | |
{ | |
return new static($array); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/**********************************************************/ | |
/* HTML PURIFICATION */ | |
/**********************************************************/ | |
/* string purify | |
* | |
* @param $dirty_html string | |
* @param $lite bool Disallow everything except u,l,i,h1,h2,h3,h4,h5,h6,strong,em,span,div; Also disallow style/class | |
* @param $customize bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
POEPID="$(ps -A -o pid,cmd|grep PathOfExile_x64Steam.exe | grep -v grep |head -n 1 | awk '{print $1}')" | |
POECONNECTION="$(lsof -np $POEPID | grep IPv4 | awk '{print $4}' | tail -n 1 | sed 's/u//g')" | |
GDBCOMMAND="call (int)close($POECONNECTION)" | |
POEIP="$(lsof -np 19380 | grep IPv4 | tail -n 1 | awk '{print $9}' | awk -F\> '{print $2}' | awk -F: '{print $1}')" | |
tcpkill host $POEIP & | |
sleep 2 | |
for child in $(jobs -p); do | |
echo kill "$child" && kill "$child" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# detect our real working directory through symlinks | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ChartjsNode = require('chartjs-node'); | |
const fs = require('fs'); | |
const tmp = require('tmp'); | |
charts = { | |
drawLineChart: function(options,onFinish) { | |
var width = options.width ? options.width : 700; | |
var height = options.height ? options.height : 400; | |
delete options.width, options.height; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* A function which simulates the register_globals setting from PHP <=5.3 for PHP >=5.4 | |
* Blasphemy I know. Just an example of named functions detailed in https://php.net/manual/en/language.variables.variable.php | |
*/ | |
function register_globals($Order = 'EGPCS') | |
{ | |
$register_globals = function(array &$GlobalArray) | |
{ | |
foreach($GlobalArray as $Variable=>$Value) | |
{ |
NewerOlder