Skip to content

Instantly share code, notes, and snippets.

View aronbudinszky's full-sized avatar

Aron Budinszky aronbudinszky

View GitHub Profile
@aronbudinszky
aronbudinszky / 1-ie-placeholder-polyfill.js
Last active December 23, 2015 11:19
A very short polyfill for IE placeholders. It's not meant to be perfect, but it is tiny and takes care of the most important use case for placeholders: to give additional info about how to fill it out. Requires jquery.
/** POLYFILL FOR IE PLACEHOLDER **/
$(document).ready(function(){
if(!('placeholder' in document.createElement('input'))){
$('input[placeholder]').each(function(){
if(this.value == ''){
var $el = $(this);
$el.bind('click', function(ev){ $(ev.target).unbind('click'); ev.target.value = ''; });
$el.val($el.attr('placeholder'));
}
});
@aronbudinszky
aronbudinszky / enable_mssql_firewall_rules.bat
Last active December 24, 2015 07:19
Run this script to enable all necessary ports on Windows Server 2012 Firewall for remote access to MS SQL. BE AWARE THAT THIS OPENS UP PORTS PUBLICLY! You should only use this on internal networks or if you have a hardware firewall.
netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80
@echo ========= SQL Server Ports ===================
@echo Enabling SQLServer default instance port 1433
netsh advfirewall firewall add rule name="SQL Server" dir=in action=allow protocol=TCP localport=1433
@echo Enabling Dedicated Admin Connection port 1434
netsh advfirewall firewall add rule name="SQL Admin Connection" dir=in action=allow protocol=TCP localport=1434
@echo Enabling Conventional SQL Server Service Broker port 4022
netsh advfirewall firewall add rule name="SQL Service Broker" dir=in action=allow protocol=TCP localport=4022
@echo Enabling Transact SQL/RPC port 135
<script>
function notify() {
var havePermission = window.webkitNotifications.checkPermission();
if (havePermission == 0) {
// 0 is PERMISSION_ALLOWED
var notification = window.webkitNotifications.createNotification(
'http://i.stack.imgur.com/dmHl0.png',
'Chrome notification!',
'Here is the notification text'
);
@dodyw
dodyw / findbot.pl
Last active October 11, 2019 10:30
Perl script to find suspicious scripts. This script is taken from http://cbl.abuseat.org/findbot.pl
#!/usr/bin/perl
# The above line may need to be changed to point at your version of Perl
#
# This script attempts to find malicious files/scripts on your machine.
# It specifically looks for spambots that we're aware of, as well
# as "suspicious" constructs in various scripting languages.
#
# Normally it should be run as root.
#
# By default, findbot.pl scans the directories /tmp, /usr/tmp, /home and
@staltz
staltz / introrx.md
Last active July 27, 2024 04:59
The introduction to Reactive Programming you've been missing
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
/// Defines the possible errors
public enum URLSessionAsyncErrors: Error {
case invalidUrlResponse, missingResponseData
}