Skip to content

Instantly share code, notes, and snippets.

View pichsenmeister's full-sized avatar
one sparkle at a time

David Pichsenmeister pichsenmeister

one sparkle at a time
View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

$token = '225242302:AAFJiXd3dSAbLAkN18MhRIGp9ZsIox5fRkM';
function sendAPIRequest($token, $method, $payload)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.telegram.org/bot$token/$method");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
(function() {
var body = document.getElementsByTagName('body')[0];
var protocol = 'http';
if(window.location.protocol == 'https') {
protocol = 'https';
}
var url = protocol+'://localhost/oratio/js/widget/stmt_include.js';
var s = document.createElement('script');
s.setAttribute('type', 'text/javascript');
s.setAttribute('src', url);
@pichsenmeister
pichsenmeister / load.js
Created August 15, 2013 20:57
angularJS and typescript load
load() {
this.http.get('http://localhost/angularTS/coffee.json').success(
(data, status) => this.coffee = <Coffee>data
);
}
@pichsenmeister
pichsenmeister / viewbind.html
Created August 15, 2013 20:56
angularJS and typescript view binding
<span>{{ vm.member }}</span>
@pichsenmeister
pichsenmeister / bind.js
Created August 15, 2013 20:55
angularJS and typescript binding
$scope.vm = this;
@pichsenmeister
pichsenmeister / ctrl.js
Last active December 21, 2015 03:49
angularJS and typescript controller
/// <reference path='../_all.ts' />
module angularTs {
'use strict';
export interface IFirstScope extends ng.IScope {
vm: FirstCtrl;
}
export class FirstCtrl {
@pichsenmeister
pichsenmeister / model.js
Last active December 21, 2015 03:48
angularJS and typescript model
/// <reference path='../_all.ts' />
module angularTs {
'use strict';
export class Coffee {
constructor(
public milk: Milk,
public size: number,
public name: string){}
@pichsenmeister
pichsenmeister / app.js
Last active December 21, 2015 03:48
angularJS and typescript app.js
/// <reference path='_all.ts' />
module angularTs {
'use strict';
var showcase = angular.module('showcase', []);
showcase.controller('firstCtrl', FirstCtrl.prototype.injection());
showcase.controller('secCtrl', SecCtrl.prototype.injection());
@pichsenmeister
pichsenmeister / includes.ts
Created August 15, 2013 20:50
angularJS and typescript includes
/// <reference path='libs/angular.d.ts' />
/// <reference path='models/MyModel.ts' />
/// <reference path='controllers/FirstCtrl.ts' />+
/// <reference path='controllers/SecCtrl.ts' />
/// <reference path='app.ts' />