Skip to content

Instantly share code, notes, and snippets.

View haigopi's full-sized avatar
💭
Who loves to code!

Gopi haigopi

💭
Who loves to code!
View GitHub Profile
@haigopi
haigopi / Http.as
Created August 1, 2018 03:06
Example of HTTP exchange inside action script.
package allibilliHTTP
{
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
public class HttpUtil
{
public var http:HTTPService=new HTTPService();
//private static var serverURL:String="http://localhost:8080/AlliBilli/";
private static var serverURL:String="http://services.allibilli.com/xml/";
@haigopi
haigopi / Example.mxml
Created August 1, 2018 03:22
A simple mxml explaining how to apply spark skin to a Halo(mx) component.
<s:Application....>
<fx:Style>
.testCustom {
skin: ClassReference("skins.TestCustomSkin");
}
</fx:Style>
<mx:Button id="accordion"
styleName="TestCustomSkin" .../>
</s:Applicartion>
@haigopi
haigopi / ImageButton.mxml
Created August 2, 2018 22:27
MXML Image Button
<mx:Image source="{isRightClosed == false?(openNav):closeNav}"
useHandCursor="true"
buttonMode="true"
mouseChildren="false"
id="closeRightNavBtn"
click="handleRightNav(event)"
left="5"
top="5"/>
public function handleRightNav(event:MouseEvent):void
{
event.stopPropagation();
event.preventDefault();
if (isRightClosed == false)
{
closeRightPane();
}
else
@haigopi
haigopi / CustomAccordian.mxml
Last active August 2, 2018 22:50
MXML accordian
<mx:Canvas width="200" height="100%" id="rightCanvas">
<mx:Box width="100%" height="100%" styleName="fseControlBar">
</mx:Box>
<mx:Box width="100%" height="100%" styleName="fseControlBar" backgroundAlpha="1">
<mx:filters> <flash.filters:BevelFilter xmlns:flash.filters="flash.filters.*"
angle="90"
blurX="1"
blurY="1"
distance="1"
@haigopi
haigopi / resize.mxml
Created August 2, 2018 22:52
Resize MXML
<mx:Resize id="rightShrink"
widthTo="25"
target="{rightCanvas}"
duration="400"
effectEnd="rightBoxLbl.visible=false; rightAcc.visible = false; "/>
<mx:Resize id="rightGrow"
widthTo="180"
target="{rightCanvas}"
duration="400"
effectEnd="rightAcc.visible = true; rightBoxLbl.visible=true;"/>
@haigopi
haigopi / Listeners.as
Created August 2, 2018 23:04
Adding and Removing
allXML.addEventListener(AlliBilliEvent.ACC_TREE_BUILD, buildTree_in_acc);
allXML.addEventListener(AlliBilliEvent.START_BUILD_UI, startBuildingUI);
addEventListener(MyCustomEvent.MyFormSearchEvent, alliBilliSearchResult);
addEventListener(AlliBilliEvent.TAB_REFRESH, refreshTab);
this.stage.removeEventListener(FullScreenEvent.FULL_SCREEN, this.fullScreenHandler);
closeButton.removeEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown);
@haigopi
haigopi / readStory.js
Last active October 9, 2018 18:24
Sample Lambda for Alexa Skill
'use strict';
const Alexa = require('alexa-sdk');
const APP_ID = "amzn1.ask.skill.072d9e35-a053-40c9-ba6c-cf7467cd1825";
const SKILL_NAME = 'Space Facts';
const GET_FACT_MESSAGE = "Here's your fact: ";
const HELP_MESSAGE = 'You can say tell me a space fact, or, you can say exit... What can I help you with?';
const HELP_REPROMPT = 'What can I help you with?';
@haigopi
haigopi / MonoExample.java
Created November 11, 2018 00:44
Mono Example
public Mono getName() {
Mono myMoana = Mono.just("Moana");
return myMoana;
}
{
scheduler = Schedulers.newElastic("FLUX_DEFER", 10, true);
ReceiverOptions<Integer, String> options = receiverOptions.subscription(Collections.singleton(topic))
.addAssignListener(partitions -> log.info("Partitions Assigned {}", printPartitions(partitions)))
.addRevokeListener(partitions -> log.info("Partitions Revoked {}", printPartitions(partitions)))
//.assignment(Collections.singleton(new TopicPartition(topic, 9))) // <-- ** EASY TEST ONLY **
.commitInterval(Duration.ZERO)
.commitBatchSize(0);