Skip to content

Instantly share code, notes, and snippets.

function sleep(milliseconds) {
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds){
break;
}
}
}
function unscramble() {
<h1 class="logo">
<span class="word1">scram</span> <br />
<span class="word2">solutions</span>
</h1>
<div class="form">
<ul class="tab-group">
<li class="tab active"><a href="#signup">Scrambled Words</a></li>
<li class="tab"><a href="#login">Word List</a></li>
@Ninjex
Ninjex / ko.js
Last active February 4, 2017 12:02
pwn the ko
// ==UserScript==
// @name FANS Poller
// @namespace https://fcswat-us.aka.amazon.com/workflow/init
// @description manages the display tabs
// @include https://fcswat-us.aka.amazon.com/workflow/init
// @version 1
// @grant none
// ==/UserScript==
// workflow message
@Ninjex
Ninjex / controller.rb
Created May 11, 2016 21:07
Base64 Encode / Decode Script
def base64
@data = params[:data]
@choice = params[:choice]
if !["encode", "decode"].include?(@choice)
render :action => 'base64'
end
end
@Ninjex
Ninjex / check-in-sid.js
Last active November 17, 2020 01:25
AmznSauce
current_url = window.location.href;
if (window.addEventListener) {
window.addEventListener("storage", handler, false);
} else {
window.attachEvent("onstorage", handler);
};
function handler(e) {
sids = JSON.parse(localStorage['sids']);
@Ninjex
Ninjex / MD5Pass.js
Last active January 10, 2018 10:42
MD5Pass
// ==UserScript==
// @name MDPass
// @namespace *
// @include https://*/*
// @description View parital MD5 values of password fields for visual comparison.
// @version 1
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
// @grant none
// ==/UserScript==
@Ninjex
Ninjex / employee.rb
Created December 17, 2014 16:22
Class Employee Example
#!/usr/bin/ruby
# Find users in the Employee hash by using their last name + first name (needs to be unique)
class Employee
attr_reader :f_name, :l_name, :email, :phone
EMPLOYEE = {}
AREA_CODE = 555 # This is just to generate number in a specific area code
PROMPT = '> '
def initialize(f_name, l_name, email, phone)
@f_name = f_name
@l_name = l_name
@Ninjex
Ninjex / ttt.rb
Created October 26, 2014 19:18
Tic Tac Toe Ruby
ran_num = rand(0..1)
if ran_num == 0
PLAYER = "X"
COMPUTER = "O"
@turn = :player
else
PLAYER = "O"
COMPUTER = "X"
@turn = :computer
end
@Ninjex
Ninjex / rps.rb
Last active August 29, 2015 14:02
Rock Paper Scissors Game Developed in Ruby
#!/usr/bin/ruby
WINS = { :computer => 0, :user => 0, :draws => 0 }
HANDLER = {
:rock => { :rock => :tie, :paper => :lose, :scissors => :win},
:paper => { :rock => :win, :paper => :tie, :scissors => :lose},
:scissors => { :rock => :lose, :paper => :win, :scissors => :tie },
}
@Ninjex
Ninjex / main.rb
Created April 28, 2014 15:29
Hellbound Hackers Timed Challenge 4
#!/usr/bin/ruby
require 'mechanize'
require 'io/console'
def decrypt(str)
final = []
for i in (0..str.length)
i.odd? ? final << str[i-2] : final << str[i]
end