Skip to content

Instantly share code, notes, and snippets.

View JoseMiralles's full-sized avatar

Jose JoseMiralles

View GitHub Profile
@JoseMiralles
JoseMiralles / Guide.md
Last active August 31, 2023 23:55
How To Create a React App In Splunk With Typescript
@JoseMiralles
JoseMiralles / test.js
Created July 31, 2019 13:51
Mocha Unit Tests Example
var assert = require('assert');
describe('Phone Numbers', function () {
it('Single Phone Number', function () {
let input = "123-123-1234";
let expectedResult = "<a href='tel:123-123-1234'>123-123-1234 </a>"
let result = convertToClickablePhoneNumbers(input);
//console.log(result);
//assert.equal(result, expectedResult);
});
@JoseMiralles
JoseMiralles / ViewController.cs
Last active July 14, 2019 22:01
Example of using autolayout programmatically in Xamarin.iOS
public partial class ViewController : UIViewController
{
#region properties
// Top Views setup
private readonly UITextView textView = new UITextView
{ TranslatesAutoresizingMaskIntoConstraints = false };
private readonly UIView topImageContainer = new UIView
{ TranslatesAutoresizingMaskIntoConstraints = false };
private readonly UIImageView imageView = new UIImageView {
TranslatesAutoresizingMaskIntoConstraints = false,
@JoseMiralles
JoseMiralles / accordionWidget.php
Created July 11, 2019 13:53
Widget function that loads multiple items dynamically.
public function widget( $args, $instance ) {
//Load all items.
$items = array();
$identifier = 0;
while(isset ($instance["title".$identifier]) ){
array_push($items,
new accordion_item(
$instance["title".$identifier],
$instance['text'.$identifier]
)
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>