This file contains 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/env python | |
import os | |
import shlex | |
import struct | |
import platform | |
import subprocess | |
def get_terminal_size(): | |
""" getTerminalSize() |
This file contains 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 | |
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
# The author disclaims copyright to this source code. | |
import sys | |
import struct | |
import socket | |
import time | |
import select |
This file contains 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
function Calculator(){ | |
this.add = function(num1, num2){ | |
if(this.isNumber([num1,num2]) == false){ | |
throw "error: invalid input to function."; | |
}else{ | |
return num1 + num2; | |
} | |
} |
This file contains 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 <LEDDisplay.h> | |
LEDDisplay *led; | |
int millisecondsPerCount; | |
int counter; | |
unsigned long lastUpdate; | |
void setup() | |
{ | |
millisecondsPerCount = 1000; |
This file contains 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 <LEDDisplay.h> | |
LEDDisplay *led; | |
void setup() | |
{ | |
int digitFlagPins[] = {10, 11}; | |
int segmentPins[] = {2, 3, 4, 5 ,6 ,7 ,8, 9}; | |
int decimalPointPin = 9; | |
led = new LEDDisplay(2, digitFlagPins, segmentPins, decimalPointPin); |
This file contains 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 UnityEngine; | |
using System.Collections; | |
public class AimAssist : MonoBehaviour { | |
void Start () { | |
} | |
void Update () { | |
Vector3 mouse_pos = Input.mousePosition; |
This file contains 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
// See http://blog.rastating.com/xna-per-pixel-collision-detection-on-rotated-objects/ for details on how to use this class | |
using System; | |
using Microsoft.Xna; | |
using Microsoft.Xna.Framework; | |
using Microsoft.Xna.Framework.Graphics; | |
namespace rastating | |
{ | |
/// <summary> |
This file contains 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 the player is coliding with the enemy turn the screen red | |
if (this.player.IsColliding(this.enemy)) | |
{ | |
GraphicsDevice.Clear(Color.Red); | |
} | |
// Draw the player to the screen | |
spriteBatch.Draw(this.player.Texture, | |
this.player.Position, | |
null, |
This file contains 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.Globalization; | |
using System.Reflection; | |
using System.Threading; | |
namespace DefaultCultureInfoExample | |
{ | |
class Program | |
{ | |
static void SetDefaultCulture(CultureInfo culture) |
This file contains 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
public void SetDefaultCulture(CultureInfo culture) | |
{ | |
Type type = typeof(CultureInfo); | |
try | |
{ | |
type.InvokeMember("s_userDefaultCulture", | |
BindingFlags.SetField | BindingFlags.NonPublic | BindingFlags.Static, | |
null, | |
culture, |