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
$bytes = "00,00,00,00,00,00,00,00,02,00,00,00,01,00,3a,00,00,00,00,00".Split(',') | % { "0x$_"}; | |
$key = 'HKLM:\System\CurrentControlSet\Control\Keyboard Layout'; | |
New-ItemProperty -Path $key -Name "Scancode Map" -PropertyType Binary -Value ([byte[]]$bytes); |
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 | |
# Renames all the files in the current directory | |
# to their sha1 checksums keeping the extension | |
# it prints the list of the converted files at | |
# the end | |
# Requires the shasum command that comes with xcode | |
ls |
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 | |
namespace App\Http\Middleware; | |
use Illuminate\Foundation\Http\Middleware\TransformsRequest; | |
class FixDates extends TransformsRequest | |
{ | |
protected function transform($key, $value) | |
{ |
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
case $1 in | |
''|*[!0-9]*) n=30 ;; | |
*) n=$1 ;; | |
esac | |
</dev/urandom tr -cd 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$@!' | head -c$n |
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 | |
#================# | |
# For CentOS 7.0 # | |
#================# | |
######## CONFIG ########## | |
user="user" | |
router="index.php" |
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
toIntPrice = (number)-> | |
price = number.match /(\d+)(\.\d{1,2})?/ | |
if price[2] | |
price[2] = price[2].replace /\./g, '' | |
console.log price | |
if price[2].length == 1 then price[2] += '0' | |
else price[2] = '00' | |
if price then price = price[1] + price[2] else price = 0 | |
return price |
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 | |
class LangCheck | |
{ | |
private $default; | |
private $available; | |
/** | |
* @param array $available An array containing the available locales | |
* @param string $default The default language in case none is found |
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 | |
# to see a more detailed progress do: | |
# tail -f install.log | |
######## CONFIG ########## | |
router="index.php" | |
serverRoot="/server" | |
domain="example.org" |