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
alert('stuff'); |
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
require 'nokogiri' | |
require 'watir' | |
require 'open-uri' | |
require 'pry' | |
class Tweetbot | |
def parse_website | |
browser = Watir::Browser.new :phantomjs | |
browser.goto('https://getpebble.com/checkout') |
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
class Player | |
def play_turn(warrior) | |
if warrior.feel.wall? | |
warrior.pivot! | |
elsif warrior.feel.captive? | |
warrior.rescue! | |
elsif warrior.feel.enemy? | |
warrior.attack! | |
elsif warrior.look.at(2).enemy? | |
warrior.shoot! |
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
tasklist /FI "IMAGENAME eq App.exe" 2>NUL | find /I /N "App.exe">NUL | |
if "%ERRORLEVEL%"=="0" echo Running ! |
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
//DECODE -> HEX TO STRING | |
String wHexString = "THIS IS A CONVERSION TEST"; | |
byte[] wRaw = new byte[wHexString.Length / 2]; | |
for (int i = 0; i < wRaw.Length; i++) | |
{ | |
wRaw[i] = Convert.ToByte(wHexString.Substring(i * 2, 2), 16); | |
} | |
String iStack = Encoding.ASCII.GetString(wRaw); | |
//ENCODE -> STRING TO HEX |
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 (StreamWriter wStreamWriter = new StreamWriter(wPathTarget)) | |
{ | |
using (StreamReader wStreamReader = new StreamReader(wPathSource)) | |
{ | |
while ((wLine = wStreamReader.ReadLine()) != null) | |
{ | |
if (!wLine.Contains(iPackageName)) | |
{ | |
wStreamWriter.WriteLine(wLine); | |
} |
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
#region Encryption | |
/// <summary> | |
/// Generate a private key | |
/// From : www.chapleau.info/blog/2011/01/06/usingsimplestringkeywithaes256encryptioninc.html | |
/// </summary> | |
private static string GenerateKey(int iKeySize) | |
{ | |
RijndaelManaged aesEncryption = new RijndaelManaged(); | |
aesEncryption.KeySize = iKeySize; | |
aesEncryption.BlockSize = 128; |
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
var actionDevices: #{jsAction @WebAPI.devices(":typeId")/}, | |
$.ajax({ | |
url: actionDevices({ | |
typeId: id | |
}), | |
dataType: 'json', | |
success: function(result) { | |
$(".deviceList ul").empty(); | |
$.each(result, function(i,value) { |