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
pub fn proxy_transfer(ctx: Context<ProxyTransfer>, amount: u64, nonce: u8) -> ProgramResult { | |
token::transfer(ctx.accounts.into(), amount)?; | |
// let seeds = &[TEST_SEED.as_bytes(), &[nonce]]; | |
let seeds: &[&[u8]] = &[ctx.accounts.authority.to_account_info().key.as_ref(), &[nonce]]; | |
let signer = &[&seeds[..]]; | |
// let cpi_ctx = CpiContext::from(&*ctx.accounts).with_signer(signer); | |
let cpi_ctx = CpiContext::new_with_signer( | |
ctx.accounts.token_program.clone(), |
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
CREATE EXTENSION btree_gist; | |
CREATE TABLE room_reservations ( | |
room_id integer, | |
reserved_at timestamptz, | |
reserved_until timestamptz, | |
canceled boolean DEFAULT false, | |
EXCLUDE USING gist ( | |
room_id WITH =, tstzrange(reserved_at, reserved_until) WITH && | |
) WHERE (not canceled) |
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
/*jshint devel: true, node: true*/ | |
| |
/** | |
* Start an embedded Node-Red instance | |
*/ | |
| |
var http = require('http'), | |
express = require("express"), | |
path = require("path"), | |
_ = require("lodash"), |
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
@Grab('com.netflix.rxjava:rxjava-groovy:0.20.7') | |
@Grab('io.reactivex:rxjava-reactive-streams:0.3.0') | |
@Grab('org.apache.camel:camel-rx:2.14.1') | |
@Grab('io.ratpack:ratpack-groovy:0.9.11') | |
@Grab('org.slf4j:slf4j-simple:1.6.6') | |
import org.apache.camel.impl.* | |
import org.apache.camel.rx.* | |
import static rx.RxReactiveStreams.toPublisher | |
import static ratpack.groovy.Groovy.ratpack | |
import static ratpack.sse.ServerSentEvents.serverSentEvents; |
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
/* https://github.com/nikos/cmskern/blob/master/playapp/public/javascripts/widgets.js*/ | |
/** | |
* Widget for displaying a complete form as specified by the given schema. | |
*/ | |
angular.widget('my:form', function(element) { | |
this.descend(true); // compiler will process children elements | |
this.directives(true); // compiler will process directives |
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
import java.net.InetSocketAddress | |
import scala.xml.{Elem, XML} | |
import org.jboss.netty.buffer.ChannelBuffers | |
import org.jboss.netty.util.CharsetUtil.UTF_8 | |
import com.twitter.finagle.Service; | |
import com.twitter.finagle.builder.ClientBuilder; | |
import com.twitter.finagle.http.{Http, RequestBuilder}; | |
import org.jboss.netty.handler.codec.http._ | |
import org.jboss.netty.buffer.ChannelBuffers.wrappedBuffer | |
import java.net.URL |