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
#New terminal in the same position | |
function nt { | |
PWD_VALUE=$PWD | |
osascript -e " | |
tell application \"System Events\" to tell process \"Terminal\" to keystroke \"n\" using command down | |
tell application \"iTerm\" to tell session -1 of current terminal to write text \"cd $PWD_VALUE\" | |
" > /dev/null 2>&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
<?php | |
$hostname = ""; | |
$username = ""; | |
$password = ""; | |
$database = ""; | |
$link = mysql_connect($hostname, $username, $password); | |
if ( ! $link) { | |
echo "<p>Could not connect to the server '" . $hostname . "'</p>\n"; | |
echo mysql_error(); |
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 bash | |
bucket=your-bucket | |
resource="/${bucket}/${file}" | |
file=/file_to_upload | |
contentType="application/x-compressed-tar" | |
dateValue=`date -R` | |
stringToSign="PUT\n\n${contentType}\n${dateValue}\n${resource}" |
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
files: | |
"/etc/nginx/conf.d/01_websockets.conf": | |
mode: "000644" | |
owner: root | |
group: root | |
content: | | |
upstream nodejs { | |
server 127.0.0.1:8081; | |
keepalive 256; | |
} |
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
$('img').error(function(){ | |
$(this).attr('src', 'assets/images/broken.png'); | |
}); |
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 mainURL = location.protocol + '//' + location.host; | |
$('a').not(':contains(mainURL)').click(function(){ | |
this.target = "_blank"; | |
}); |
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
# OLD = Before 4 weeks | |
kMDItemLastUsedDate < $time.this_week(-4) |
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 | |
iptables -F | |
# Defautlt policy | |
iptables -P INPUT DROP | |
iptables -P OUTPUT ACCEPT | |
iptables -P FORWARD DROP | |
# drop invalid packets | |
iptables -A INPUT -m state --state INVALID -j DROP |
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
Show hidden characters
{ | |
"extends": [ | |
"tslint:recommended", | |
"tslint-react", | |
"tslint-config-prettier" | |
], | |
"linterOptions": { | |
"exclude": [ | |
"config/**/*.js", | |
"node_modules/**/*.ts", |
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
este#es#un#fichero#"csv"#aunque | |
no#lo#parezca#para,nada | |
123 | |
1+2=tres# | |
# |
OlderNewer