Skip to content

Instantly share code, notes, and snippets.

View Deathnerd's full-sized avatar

Wes Gilleland Deathnerd

  • eLink Design
  • Lexington, KY
View GitHub Profile
@Deathnerd
Deathnerd / using_git-svn.md
Last active July 21, 2018 16:33 — forked from rickyah/using_git-svn.md
A simple guide to git-svn

Getting started with git-svn

git-svn is a git command that allows using git to interact with Subversion repositories.git-svn is part of git, meaning that is NOT a plugin but actually bundled with your git installation. SourceTree also happens to support this command so you can use it with your usual workflow.

Reference: http://git-scm.com/book/en/v1/Git-and-Other-Systems-Git-and-Subversion

Cloning the SVN repository

You need to create a new local copy of the repository with the command

@Deathnerd
Deathnerd / ssid-sniffer-scapy-python.py
Created November 23, 2016 18:34 — forked from securitytube/ssid-sniffer-scapy-python.py
WLAN SSID Sniffer in Python using Scapy
#!/usr/bin/env python
from scapy.all import *
ap_list = []
def PacketHandler(pkt) :
if pkt.haslayer(Dot11) :
if pkt.type == 0 and pkt.subtype == 8 :
<?php
function get($topic, $specific = null, $param = null)
{
if(isset($this->config[$topic][$specific][$param])) {
return $this->config[$topic][$specific][$param];
} elseif(isset($this->config[$topic][$specific])) {
return $this->config[$topic][$specific];
}
return $this->config[$topic] ?: null;
@Deathnerd
Deathnerd / callbacktopia.js
Created May 31, 2016 17:53
This is why people have such a beef with JavaScript
var ArticleAnimator = ArticleAnimator || {
canScroll: true,
initialLoad: true,
animationDuration: 500,
postCount: 5,
currentPostIndex: 1,
postCache: <?= json_encode($postsJSON); ?>,
pageTemplate: null
};
@Deathnerd
Deathnerd / schema.sql
Last active April 26, 2016 18:56
CSC 545 Group Project Schema
/*
BEGIN ENTITY TABLES
*/
DROP TABLE menu;
CREATE TABLE menu (
time_of_day NVARCHAR2(10) NOT NULL CHECK (time_of_day IN ('breakfast', 'lunch', 'dinner')),
"date" DATE NOT NULL, -- Are we gonna enforce date format here?
CONSTRAINT pk PRIMARY KEY (time_of_day, "date")
);
@Deathnerd
Deathnerd / incr_decr_binary_string.py
Created April 7, 2016 18:08
Python to increment and decrement a binary string without converting to int. Decr does not take into account underflows
def incr(bit_string):
carry = False
bits = list(bit_string[::-1])
for i, bit in enumerate(bits):
carry = bit != "0"
if bit == "0":
bits[i] = "1"
break
else:
bits[i] = "0"
@Deathnerd
Deathnerd / Annotation Forms Example.php
Last active March 11, 2016 21:43
A rough example of what using annotations to control form validation and rendering could look like
<?php
/**
* Must annotate as a Form. This can also hold
* metadata about the form later on. In this example, if csrf is
* set to true, it enables csrf protection automatically.
*
* It's also very trivial to implement localization and have it automatically
* localize things such as Label texts at render time
*
from math import factorial
def binomial_coefficient(n, k):
"""
Find the binomial coefficient of nCk. This is space efficient
because it doesn't store the entire Pascal's Triangle; only the
current row you're working on.
:param n:
:param k:
@Deathnerd
Deathnerd / ncouples.py
Created February 27, 2016 17:57
A dynamic programming approach to the n-couples problem
from math import factorial
def binomial_coefficient(n, k):
"""
Find the binomial coefficient of nCk. This is space efficient
because it doesn't store the entire Pascal's Triangle; only the
current row you're working on.
:param n:
:param k:
@Deathnerd
Deathnerd / Test.py
Created February 27, 2016 17:42 — forked from anonymous/Test.py
def factorial(n):
if (n == 0):
return 1
elif (n == 1):
return n
else:
return n * factorial(n-1)
def nCk(n,k):
return factorial(n)/(factorial(k)*factorial(n-k))