Skip to content

Instantly share code, notes, and snippets.

Avatar

Jared Wasinger jwasinger

View GitHub Profile
View gist:1138af2e98c4488f9387
int get_ip_from_hostname(char *host, char **output, int ip_v6)
{
int error;
struct addrinfo hints, *res;
struct in_addr addr;
struct in6_addr addr6;
if(!host || !output)
{
View gist:181467e2e373b588b820
url(r'^onid_transition/(?P<user_code>\w+)$', 'list_app.views.onid_transition', name='onid_transition')
#example: https://.../onid_transition/842f3611c9b1f91f68bee646836679
#how I'm currently trying to access the 'user_code' portion of the url in my template to create a link to another view that
#also requires the 'user_code' as a parameter:
"{% url 'list_app:no_onid' user_code=onid_transition.user_code%}"
View gist:12cd8958598d987cdaf7
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
// Global variables
// The main window class name.
static TCHAR szWindowClass[] = _T("win32app");
View gist:0acff5fde55de3f00c2a
MIGRATION_HOST='localhost'
MIGRATION_USER='maintain_sb'
MIGRATION_PASSWD=''
MIGRATION_DB='maintain'
View gist:78af744d75bbd7cfdebe
if not obj and pk:
obj = get_object_or_404(Klass, pk=pk)
elif not obj and pk:
raise Exception("pk or obj required.")
View gist:f1b311d002a5d26ca956
======================================================================
ERROR: Test that adding data triggers a rebuild
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jared/projects/cyder/cyder/cydhcp/build/tests/build_tests.py", line 66, in test_build_and_push
self.builder.build()
File "/home/jared/projects/cyder/cyder/cydhcp/build/builder.py", line 114, in build
self.check_syntax()
File "/home/jared/projects/cyder/cyder/cydhcp/build/builder.py", line 140, in check_syntax
self.dhcpd, os.path.join(self.stage_dir, self.check_file)
View gist:c26faa9cdc82f8bd051f
function foo()
{
var promise = new Promise();
my_async(args, function callback()
{
//do something
...
if(error_happens)
{
promise.reject(error_value); //calls the 'error' function in promise.then()
View gist:ab9ed68cdf123f5c72d4
function foo()
{
my_async(args, function(){
return val; //this returns from foo()
})
}
var val = foo(); //same val as returned by asnyc function
View robot.asm
;***********************************************************
;*
;* robot.asm
;*
;* This is the RECEIVE file for Lab 8 of ECE 375
;*
;***********************************************************
;*
;* Author: Enter your name
;* Date: Enter Date
@jwasinger
jwasinger / message_header.c
Last active Mar 15, 2016
Message Header RNC
View message_header.c
#define TYPE_POST_CHUNK 1
//post chunk followed by ChunkHeader and payload
#define TYPE_REQUEST_CHUNK 2
//request chunk followed by null-terminated chunk file name str
#define TYPE_ACKNOWLEDGE 3
//message followed by nothing
#define TYPE_ERROR 4
You can’t perform that action at this time.