This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create your views here. | |
from redirects.models import get_redirect | |
from django.http.response import HttpResponseRedirectBase, HttpResponseNotFound | |
import logging | |
logger = logging.getLogger(__name__) | |
from django_bouncy.views import endpoint | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.contrib.auth.models import User | |
import datetime | |
from datetime import timedelta | |
import uuid | |
from django.db.models.signals import post_save,pre_save | |
from django.dispatch import receiver | |
class Image(models.Model): | |
""" This is an image. Declaring it seperate to the blog allows it to be reused. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Messaging; | |
using System.Runtime.Remoting.Messaging; | |
using System.Text; | |
using System.Threading.Tasks; | |
using NDesk.Options; | |
namespace Send_MSMQ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF OBJECT_ID('tempdb..#tempRecon') IS NOT NULL | |
DROP TABLE #tempRecon | |
SELECT * into #tempRecon FROM OPENROWSET('SQLNCLI', 'Server=xxx;Database=xxx;Uid=xxx;Pwd=xxx','SET FMTONLY OFF;SET NOCOUNT ON;EXEC rpt.xxx') | |
SELECT * FROM #tempRecon | |
order by Diff desc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @Process VARCHAR(1) = 'C' | |
--CREATE DATABASE SimulatedWorkers; | |
--GO | |
--DROP TABLE SimulatedWorkers.dbo.Jobs; | |
--GO | |
--CREATE TABLE SimulatedWorkers.dbo.Jobs ( | |
--JobId int PRIMARY KEY IDENTITY(1,1), JobCommand VARCHAR(max), JobStatus VARCHAR(1), LockedByWorker uniqueidentifier, JobOutput VARCHAR(max) | |
--) | |
--GO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Security.Cryptography.X509Certificates; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
//Dependent on your Nvidia graphics card. Mine had a BLOCK_SIZE of 32. | |
#define BLOCK_SIZE 32 | |
#define TILE_SIZE 32 | |
//Rounds the value up to a multiple of BLOCK_SIZE. | |
//Usage found down south: dim3 dimGridProj(iDivUp(rowCount,BLOCK_SIZE), iDivUp(columnCount,BLOCK_SIZE)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MessageQueue queue = new MessageQueue("FormatName:DIRECT=OS:<queue_address>") | |
{ | |
MessageReadPropertyFilter = new MessagePropertyFilter | |
{ | |
ArrivedTime = true, | |
Body = true | |
} | |
}; | |
Console.WriteLine(queue.CanRead.ToString()); | |
Console.WriteLine(queue.CanWrite.ToString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from __future__ import with_statement | |
from fabric.api import local, settings, abort, run, cd,env,sudo | |
from fabric.contrib.console import confirm | |
env.hosts = ['<server>'] | |
env.user = '<user>' | |
salt_interface = '0.0.0.0' #Bind to all | |
salt_master = 'salt.<domain>' #Set up your subdomain salt, I like this version. |