-
abs(float)
- Returns the absolute value of a given float. Example:abs(1)
returns1
, andabs(-1)
would also return1
, whereasabs(-3.14)
would return3.14
. See also thesignum
function. -
basename(path)
- Returns the last element of a path. -
base64decode(string)
- Given a base64-encoded string, decodes it and returns the original string.
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
// ==UserScript== | |
// @name Remove Blur-2xl | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Removes blur-2xl class from all elements | |
// @author You | |
// @match *://*/* | |
// @grant none | |
// @run-at document-idle | |
// ==UserScript== |
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
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli | |
KEY_ID=alias/my-key | |
SECRET_BLOB_PATH=fileb://my-secret-blob | |
SECRET_TEXT="my secret text" | |
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob | |
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target | |
encrypt-text: |
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
### Keybase proof | |
I hereby claim: | |
* I am nappa32 on github. | |
* I am nappa32 (https://keybase.io/nappa32) on keybase. | |
* I have a public key ASD_a7VnIEfJtlpqUsngCaquY6dzak3_dxnLwEVhkRD83Qo | |
To claim this, I am signing this object: |
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
function githubssh () | |
{ | |
newremote=$(git remote -v|head -1 |sed 's/https:\/\/github.com\//[email protected]:/g'|awk '{print $2}'); | |
git remote set-url origin $newremote | |
} | |
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
task :task1 => [:big_db_task] do | |
sleep 1 | |
puts "Task 1" | |
end | |
task :big_db_task do | |
puts "Big db task" | |
end | |
task :task3 => [:big_db_task] do | |
puts "Task 3" | |
end |
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
server { | |
listen 80; | |
listen [::]:80; | |
server_name yourserver.com; | |
root /path/to/your/htdocs; | |
error_page 404 /404.html | |
index index.html; |
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
class Sanitise | |
{ | |
public function get($name, $filter, $options=null) | |
{ | |
return $this->sanitise(INPUT_GET, $name, $filter, $options); | |
} | |
public function post($name, $filter, $options=null) | |
{ | |
return $this->sanitise(INPUT_POST, $name, $filter, $options); |
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 | |
function get_param($key, $filter=FILTER_SANITIZE_STRING) { | |
if (!isset($_GET[$key])) { | |
return null; | |
} | |
return filter_var($_GET[$key], $filter); | |
} | |
function post_param($key, $filter=FILTER_SANITIZE_STRING) { |
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 | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
NewerOlder