most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
<?php | |
$url = "https://ws.ovh.com/dedicated/r2/ws.dispatcher/getAvailability2?callback=Request.JSONP.request_map.request_0"; | |
$content = file_get_contents($url); | |
$content = substr($content, strlen("Request.JSONP.request_map.request_0(")); | |
$content = substr($content, 0, strlen($content) - 2); | |
$content = json_decode($content); |
<?php | |
class ThemosisValetDriver extends BasicValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
// inside boot() | |
resolve(EngineManager::class)->extend('elasticsearch', function () { | |
return new ElasticsearchEngine(ClientBuilder::fromConfig(config('scout.elasticsearch.config')), config('scout.elasticsearch.index')); | |
}); |
/*! | |
* | |
* NEW VERSION AT https://github.com/c-kick/mobileConsole | |
* | |
* hnl.mobileConsole - javascript mobile console - v1.3.8 - 04/01/2021 | |
* Adds html console to webpage. Especially useful for debugging JS on mobile devices. | |
* Supports 'log', 'trace', 'info', 'warn', 'error', 'group', 'groupEnd', 'table', 'assert', 'clear' | |
* Inspired by code by Jakub Fiala (https://gist.github.com/jakubfiala/8fe3461ab6508f46003d) | |
* Licensed under the MIT license | |
* |
var pair = function (x, y) { | |
return x << 16 & 0xffff0000 | y & 0x0000ffff; | |
}; | |
var depair = function (p) { | |
return [p >> 16 & 0xFFFF, p & 0xFFFF] | |
}; |
#!/usr/bin/env bash | |
echo ">>> Starting Install Script" | |
# Update | |
sudo apt-get update | |
# Install MySQL without prompt | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' |
# Initial setup | |
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name | |
cd project-name | |
git checkout --orphan master | |
git commit -m "Initial commit" | |
# Pulling changes | |
git fetch framework | |
git merge --squash -m "Upgrade Laravel" framework/develop | |
# Fix merge conflicts if any and commit |
<?php | |
include 'str_format.php'; | |
// example 1 | |
echo str_format(':foo + :bar = :baz', array( | |
'foo' => 5, | |
'bar' => 6, | |
'baz' => 11, | |
)); |
#! /usr/bin/python | |
from sys import argv | |
from os.path import exists | |
from os import makedirs | |
from os import symlink | |
from os import system | |
import getopt | |
# |