Skip to content

Instantly share code, notes, and snippets.

View jonhermansen's full-sized avatar
😈
I may be slow to respond.

jonhermansen

😈
I may be slow to respond.
View GitHub Profile
@traviskaufman
traviskaufman / jasmine-this-vars.md
Last active January 4, 2025 16:49
Better Jasmine Tests With `this`

Better Jasmine Tests With this

On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this object, and we've seen some awesome benefits from doing such.

The old way

Up until recently, a typical unit test for us looked something like this:

describe('views.Card', function() {
@kyledrake
kyledrake / ferengi-plan.txt
Last active November 14, 2025 04:39
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@hagish
hagish / README
Created May 11, 2014 18:28
running unity unit tests in jenkins
prerequisite
* jenkins on windows
* unity on windows
* YOUR_UNIT_PROJECT contains the unity project in the jenkins workspace
howto
* UNTIY: install Unity Test Tools https://www.assetstore.unity3d.com/#/content/13802
* UNITY: write some unit tests
* JENKINS: add build step "Execute windows batch command" with "run_tests.bat"
* JENKINS: add build set "Publish NUnit test result report" with "unity_unittests_results.xml"
@martinaglv
martinaglv / 01.js
Last active July 25, 2024 03:38
What do these functions do?
function whatDoesItDo(val){
return val ? 1 : 2;
}
@bcoles
bcoles / shellinabox.rb
Created August 25, 2014 11:05
This module uses valid credentials to log in to Shell In A Box and execute arbitrary operating system commands. Shell In A Box must be configured to use the system shell (default).
##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = AverageRanking
@tanacasino
tanacasino / GitBucketAPIPlan.md
Last active March 2, 2018 15:16
GitBucket API Plan

GitBucket API Plan

Goal

Provides GitHub API v3 compatibility and support for popular ecosystem tools.

Steps

#!/usr/bin/env bash
size=1024 # MB
mount_point=$HOME/tmp
name=$(basename "$mount_point")
usage() {
echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \
"(default: mount)" >&2
}
@mefellows
mefellows / ec2-user-data.ps1
Last active May 28, 2021 11:44
Packer Community Plugins - Example Windows 2012 Setup
<powershell>
write-output "Running User Data Script"
write-host "(host) Running User Data Script"
cmd.exe /c net user /add vagrant FooBar@123
cmd.exe /c net localgroup administrators vagrant /add
Set-ExecutionPolicy -ExecutionPolicy bypass -Force
# RDP
@zeroSteiner
zeroSteiner / cli_mailer.py
Last active January 27, 2022 00:36
King Phisher CLI Mail Utility
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tools/cli_mailer.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright