Skip to content

Instantly share code, notes, and snippets.

View noobzhax's full-sized avatar
🎯
Focusing

nb noobzhax

🎯
Focusing
View GitHub Profile
@dtran320
dtran320 / gist:1106059
Created July 26, 2011 05:45
Extract referrer domain name in javascript
function getReferrerDomain() {
var url = document.createElement('a');
url.href = document.referrer;
return url.hostname;
}
@incanus
incanus / gist:1439684
Created December 6, 2011 19:56
Script to export Heroku environment variables to the local shell
#!/bin/sh
for x in `heroku config`; do
if [[ $x == HUBOT* ]]; then
name=$x
elif [ $x != '=>' ]; then
value=$x
export $name=$value
fi
done
@jathanism
jathanism / config
Created May 21, 2013 20:13
privoxy config
# Sample Configuration File for Privoxy v3.0.19
#
# $Id: config,v 1.98 2011/12/26 17:04:50 fabiankeil Exp $
#
# Copyright (C) 2001-2011 Privoxy Developers http://www.privoxy.org/
#
####################################################################
# #
# Table of Contents #
# #
@bertspaan
bertspaan / README.md
Created January 2, 2014 15:28
Python script to convert DBF database file to CSV
@jeruyyap
jeruyyap / Matching Rijndael-128 in C#.NET, PHP, and Python
Last active March 18, 2024 07:05
Matching Encrypt/Decrypt Methods With Rijndael-128, CBC Mode, PKCS7 Padding in C#.NET, PHP, And Python
DO NOT use these as-is for anything important!
These are only very basic examples and they are missing much of what would be needed for a real-world use case.
These are snippets for matching encrypt and decrypt (Rijndael-128 in CBC mode with PKCS7 padding) in C#.NET, PHP, and Python.
I cobbled these together from various existing examples because at the time it seemed like a lot of existing examples out there for different languages/platforms did not quite match and would require quite a bit more work before they would encrypt/decrypt identically.
Each of these take Keys and IVs that are 16 character strings encoded in base64.
@eduardomello
eduardomello / preg_replace_test.php
Created March 9, 2015 17:43
use of PHP preg_replace() to add basepath to src and href
<?php
/*
* Script that shows how to insert a basepath on HTML tags
* It looks for link, script and img tags that do not contain the
* determined basepath or a external URL
*/
// BasePath to insert in string when necessarry
$basePath = "/project/site/";
$escapedBasePath = str_replace("/", "\/", $basePath);
@JamesMessinger
JamesMessinger / IndexedDB101.js
Last active May 19, 2024 18:56
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
@alirobe
alirobe / reclaimWindows10.ps1
Last active July 3, 2024 09:36
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@celisflen-bers
celisflen-bers / README.md
Last active March 11, 2022 11:45 — forked from bertspaan/README.md
Python script to convert DBF database file to CSV
@nickoala
nickoala / 0_python_email.md
Last active June 16, 2024 12:58
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria