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
var fs = require('fs'); | |
var url = require('url'); | |
var https = require('https'); | |
var exec = require('child_process').exec; | |
var simpleGit = require('simple-git')(); | |
var archiver = require('archiver'); | |
var token = '[Your GitHub OAuth Token]'; | |
var file_name = './deploy'; | |
var version = '122632'; |
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
public class CheckBoxAdapter extends BaseAdapter { | |
@Override | |
public int getCount() { | |
return 0; | |
} | |
@Override | |
public Object getItem(int position) { | |
return null; | |
} |
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
#.bash_profile | |
if [ -f ~/.bashrc ]; then | |
. ~/.bashrc | |
fi | |
#============================================================ | |
# | |
# ALIASES AND FUNCTIONS | |
# Arguably, some functions defined here are quite big. | |
# If you want to make this file smaller, these functions can |
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
private void MainTabChanged(object sender, SelectionChangedEventArgs e) | |
{ | |
int tabItem = ((sender as TabControl)).SelectedIndex; | |
if (e.Source is TabControl) // This is a soultion of those problem. | |
{ | |
switch (tabItem) | |
{ | |
case 0: // Chatting | |
Debug.WriteLine("Tab: Chatting"); | |
if (MainChatList.Items.Count > 0) |
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
ListView mList = (ListView) findViewById(R.id.mainList); | |
String[] items = new String[] { | |
"Hello World!", | |
"Foo Bar", | |
"404 Not Found", | |
"Dev Students" | |
}; | |
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, items); | |
mList.setAdapter(adapter); |
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
ListBoxItem lb = new ListBoxItem(); | |
DockPanel dp = new DockPanel(); | |
TextBlock user = new TextBlock(); | |
user.Text = data.name; | |
if(data.color != null) | |
{ | |
user.Foreground = (SolidColorBrush)(new BrushConverter().ConvertFrom("#" + data.color)); | |
} | |
TextBlock tb = new TextBlock(); | |
tb.TextWrapping = TextWrapping.Wrap; |
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
ListBoxItem lb = new ListBoxItem(); | |
TextBlock tb = new TextBlock(); | |
/* ListView TextWrapping using TextBlock. */ | |
tb.TextWrapping = TextWrapping.Wrap; | |
tb.Text = data; | |
lb.Content = tb; | |
MainChatList.Items.Add(lb); | |
MainChatList.SelectedIndex = MainChatList.Items.Count - 1; | |
MainChatList.ScrollIntoView(MainChatList.Items[MainChatList.Items.Count - 1]); |
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
private List<byte> bnetData = new List<byte>(); | |
private BnetHelper bnetHelper = BnetHelper.getInstance(); | |
public byte bnetCommand; | |
public int serverToken = 0; | |
public int clientToken = 0; | |
public BnetProtocol() | |
{ | |
} |
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
IPAddress bnetServerIP = Dns.GetHostAddresses(bnetConInfo["ip"])[0]; | |
IPEndPoint bnetServerEP = new IPEndPoint(bnetServerIP, Int32.Parse(bnetConInfo["port"])); | |
this.bnetSock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); | |
byte[] receiveBuffer = new byte[255]; | |
try | |
{ | |
this.bnetSock.ReceiveBufferSize = Int32.MaxValue; | |
this.bnetSock.ReceiveTimeout = 3000; | |
this.getHandleMsg(BnetCode.ConnectionWithServer); |
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
public void setBnetByte(String strData, bool isVariable = false) | |
{ | |
String hexData = bnetHelper.Acsii2Hex(strData); | |
if (isVariable) | |
{ | |
byte[] bData = bnetHelper.Hex2Byte(hexData); | |
this.setBnetByte(bData); | |
} | |
else { | |
UInt32 intData = UInt32.Parse(hexData, System.Globalization.NumberStyles.AllowHexSpecifier); |