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
// @source: http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript | |
function randomStr(m) { | |
var m = m || 9; s = '', r = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | |
for (var i=0; i < m; i++) { s += r.charAt(Math.floor(Math.random()*r.length)); } | |
return s; | |
}; |
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 | |
/* | |
DONT FORGET TO DELETE THIS SCRIPT WHEN FINISHED! | |
*/ | |
ini_set( 'display_errors', 1 ); | |
error_reporting( E_ALL ); | |
$from = 'webmaster@example.com'; |
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 crc16( $str, $params = array() ) | |
{ | |
$defaults = array( | |
'initial_value' => 0xFFFF, | |
'polynomial' => 0x1021, // CRC-CCITT | |
'xor_out' => 0, | |
); | |
foreach ( $defaults as $k => $v ) |
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 | |
## | |
# General OpenSSL Commands | |
# | |
# These commands allow you to generate CSRs, Certificates, | |
# Private Keys and do other miscellaneous tasks. | |
## | |
DOMAIN_NAME=$1 |
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
// source: http://graphicdesign.stackexchange.com/a/46923 | |
// forked from animalia, translated to English by arnaudin | |
var w = new Window("dialog { text: 'PDF Loader', frameLocation:[400, 200], alignChildren:['fill', 'top'], filePnl: Panel { text: 'PDF file', orientation:'row', alignChildren:['left', 'center'], loadBtn: Button { text:'Select file...', helpTip :'Browse for a file, or paste the file path into the text box to the right.'}, et: EditText { text:'' , preferredSize: [220, 20]}, }, rangePnl: Panel { text: 'Pages', orientation:'column', alignChildren:['fill', 'top'], range: Group {allRb: RadioButton { text:'All pages', value:true, helpTip: 'Import all pages in the PDF file.'}, rangeRb: RadioButton { text:'Page range:', helpTip: 'Select a range of pages to import. For example: 1-5 or 1, 2, 3 or 1, 2-4, 5, 7-8.'} et: EditText { text: '', characters:25, properties:{multiline:true} }}, caGrp: Group{artboardsCb: Checkbox { text:'Create Artboards', preferredSize: [84, 20], helpTip: 'Create Artboards in Illust |
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 | |
URL='https://nordvpn.com/wp-admin/admin-ajax.php?action=get_user_info_data' | |
JSON=$(curl -s $URL) | |
printf "\n" | |
#echo $JSON | python -m json.tool | |
echo $JSON | python -c 'import sys, json; data = json.load(sys.stdin); print "IP: %s (%s)\nStatus: %s" % (data["ip"], data["isp"], "\033[32mProtected" if data["status"] is True else "\033[31mUnprotected");' | |
printf "\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 | |
# | |
# Iterate through every .MKV file in the current directory and use the | |
# filename base as the title while assigning the second subtitle track | |
# as the default and the second audio track as the default. | |
# | |
# Requires mkvpropedit from MKVToolNix: | |
# https://github.com/mbunkus/mkvtoolnix | |
# | |
for file in *.mkv; do base=${file%.*}; mkvpropedit "${file}" --edit info --set "title=${base}" --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1 --edit track:a1 --set flag-default=0 --edit track:a2 --set flag-default=1; 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
on idle | |
tell application "System Events" | |
tell current location of network preferences | |
set myConnection to the service "WorkVPN" | |
if myConnection is not null then | |
if current configuration of myConnection is not connected then | |
connect myConnection | |
end if | |
end if | |
end tell |
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
$ cd /usr/local/lib | |
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib | |
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.4.dylib |
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
// Paste the snippet in Chrome console and hit enter. | |
// Source: https://chrome.google.com/webstore/detail/dont-fuck-with-paste/nkgllhigpcljnhoakjkgaieabnkmgdkb | |
document.addEventListener('paste', (e) => { e.stopImmediatePropagation(); return true; }, true); |
OlderNewer