Skip to content

Instantly share code, notes, and snippets.

View emtee40's full-sized avatar

emtee40 emtee40

View GitHub Profile
@emtee40
emtee40 / gist:e69c9a4e76b5ce1ffa18db429d31271c
Created February 22, 2018 02:50 — forked from saltybeagle/gist:6023023
The Eagles — Moscow Airport Terminal (Edward Snowden Anthem)
On a dark server farm, the NSA lies in wait
Machines that have been listening, since 1998.
Up a head in the distance, I saw a shimmering light
My head grew heavy and my laptop grew dim
I had to get off of the flight
There he stood in the terminal.
With the passport scanning system
And I was thinking to myself
"This could be deportation or this could be asylum"
<useragentswitcher>
<folder description="Browsers - Windows">
<folder description="Legacy Browsers">
<useragent description="Arora 0.6.0 - (Vista)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.6 (Change: )" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Avant Browser 1.2" useragent="Avant Browser/1.2.789rel1 (http://www.avantbrowser.com)" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Chrome 4.0 (Win 7)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/>
<useragent description="Chrome 5.0 (Server 2003)" useragent="Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9" appcodename="" appname="" appversion=
@emtee40
emtee40 / jQuery.stringify.js
Last active June 24, 2018 18:35 — forked from chicagoworks/jQuery.stringify.js
jQuery.stringify() utility
/**
* converted stringify() to jQuery plugin.
* serializes a simple object to a JSON formatted string.
* Note: stringify() is different from jQuery.serialize() which URLEncodes form elements
*
* UPDATES:
* Added suggestion end double quote
* Added suggestion from comments in source that will provide function on an older browser like IE6/7
* Added a fix to skip over Object.prototype members added by the prototype.js library
*
@emtee40
emtee40 / AdbCommands
Created July 18, 2018 04:03 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@emtee40
emtee40 / Clone a branch
Created August 14, 2018 23:18 — forked from chadwick37/Clone a branch
Clone a specific branch on a github repo
git clone -b {branch} git@github.com:{repo_name}.git
@emtee40
emtee40 / NonAdmin.cmd
Created September 13, 2018 13:46 — forked from ferventcoder/NonAdmin.cmd
Installing Software as a Non-Administrator Using Chocolatey
:: Pick one of these two files (cmd or ps1)
:: Set directory for installation - Chocolatey does not lock
:: down the directory if not the default
SET INSTALLDIR=c:\ProgramData\chocoportable
setx ChocolateyInstall %INSTALLDIR%
:: All install options - offline, proxy, etc at
:: https://chocolatey.org/install
@powershell -NoProfile -ExecutionPolicy Bypass -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH="%PATH%;%INSTALLDIR%\bin"
@emtee40
emtee40 / disablechromeautoupdate.ps1
Created September 13, 2018 13:47 — forked from ferventcoder/disablechromeautoupdate.ps1
Disable Google Chrome Automatic Update Policy
$googlePoliciesKey = 'HKLM:\Software\Policies\Google'
if (!(Test-Path $googlePoliciesKey)) {
New-Item -Path $googlePoliciesKey -Force | Out-Null
}
New-ItemProperty $googlePoliciesKey -Name 'UpdateDefault' -Value 0 -PropertyType DWORD -Force | Out-Null
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$psFileFullPath = Join-Path $toolsDir "ps1crash.ps1"
Install-BinFile `
-Name ps1crash `
-Path "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" `
-Command "-NoProfile -ExecutionPolicy unrestricted -Command `"&'$psFileFullPath' %*`""
@emtee40
emtee40 / luhn_checksum.rb
Created September 18, 2018 14:26 — forked from henrik/luhn_checksum.rb
Luhn checksum/check digit generation in Ruby.
class Luhn
def self.checksum(number)
digits = number.to_s.reverse.scan(/\d/).map { |x| x.to_i }
digits = digits.each_with_index.map { |d, i|
d *= 2 if i.even?
d > 9 ? d - 9 : d
}
sum = digits.inject(0) { |m, x| m + x }
mod = 10 - sum % 10
mod==10 ? 0 : mod
@emtee40
emtee40 / gist:d39f3dbd3deb5a39a1020ffabe84e619
Created September 18, 2018 14:27 — forked from tinogomes/gist:1182499
credit card validation on ruby
# References
# http://en.wikipedia.org/wiki/Bank_card_number
# http://en.wikipedia.org/wiki/Luhn_algorithm
def valid_credit_card?(number)
number = number.to_s.gsub(/\D/, "")
return false unless valid_association?(number)
number.reverse!