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
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View viewFrag = inflater.inflate(R.layout.fragment_prop, container, false); | |
propArrayAdapter = new ArrayAdapter<Prop>(getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, ServerLink.properties); | |
setListAdapter(propArrayAdapter); | |
return viewFrag; | |
} |
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 Event createEvent(String location, String dateString, String timeString, String nameString){ | |
ContentValues values = new ContentValues(); | |
values.put(MySQLiteHelper.COLUMN_LOCATION, location); | |
values.put(MySQLiteHelper.COLUMN_DATE, dateString); | |
values.put(MySQLiteHelper.COLUMN_TIME, timeString); | |
values.put(MySQLiteHelper.COLUMN_NAME, nameString); | |
// This inserts the entry to the database | |
long insertId = database.insert(MySQLiteHelper.TABLE_EVENTS, null, values); | |
// This makes sure that the database points to the new product |
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 class EventAdd extends Fragment { | |
Date simpleDateFormat; | |
TextView dateText; | |
TextView timeText; | |
EditText locationText; | |
EditText nameText; | |
Button addEventBtn; | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { |
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 class AuthHttpHandler { | |
private String URI_GET_AUTH = "http://melfridinbot.appspot.com/mobile/checkauth"; | |
protected void authRequest(String mobilePassword, String userEmail) throws NoSuchAlgorithmException, IOException { | |
HttpClient client = new DefaultHttpClient(); | |
HttpGet getRequest = new HttpGet(URI_GET_AUTH); | |
getRequest.addHeader("token", getMD5(mobilePassword)); | |
getRequest.addHeader("tokenDate", getDate()); |
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 String getMD5(String mobilePassword) throws NoSuchAlgorithmException { | |
MessageDigest md = MessageDigest.getInstance("MD5"); | |
String fullHash = mobilePassword + getDate(); | |
md.update(fullHash.getBytes()); | |
byte byteData[] = md.digest(); | |
StringBuffer hexString = new StringBuffer(); | |
for (int i=0;i<byteData.length;i++) { |
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 disco() { | |
function randomElement(arr) { | |
return arr[Math.floor(Math.random() * (arr.length - 1))]; | |
} | |
var blocks = Array.prototype.slice.call(document.querySelectorAll("#wallboard .build > .result")); | |
var colours = ["pink", "blue", "white", "purple", "grey", "red", "yellow"]; | |
var randomBlock = randomElement(blocks) | |
randomBlock.style.background = randomElement(colours); |
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; | |
namespace EnemyBehaviour | |
{ | |
public class Attack : IEnemyBehaviour | |
{ | |
public EnemyController EnemyCtrl | |
{ | |
get => mobile.m_EnemyController; | |
} |
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
call plug#begin('~/.config/nvim/plugged') | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
Plug 'ycm-core/YouCompleteMe', { 'do': './install.py' } | |
Plug 'slashmili/alchemist.vim' | |
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | |
Plug 'elixir-editors/vim-elixir' | |
Plug 'itchyny/lightline.vim' | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
"runtime" | |
"sync" | |
"syscall" | |
"time" |
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
--[[ | |
lvim is the global options object | |
Linters should be | |
filled in as strings with either | |
a global executable or a path to | |
an executable | |
]] | |
-- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT |
OlderNewer