Skip to content

Instantly share code, notes, and snippets.

Zlati Pehlivanov talamaska

  • Bulgaria
Block or report user

Report or block talamaska

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@talamaska
talamaska / registrar.js
Created Nov 10, 2012 — forked from mheadd/registrar.js
A simple SIP registrar that uses Node.js and Redis
View registrar.js
var sip = require('sip');
var sys = require('sys');
var redis = require('redis');
//Trim leading and trailing whitespace from string values.
function trim(str) {
return str.replace(/^\s+|\s+$/g, '');
}
sip.start({},function(request) {
View Github's usage of the showdown.js in example
$(function() {
var converter = new Showdown.converter();
$("#user_input").keyup(function(){
var txt = $("#user_input").val();
var html = converter.makeHtml(txt);
$("#result").html(html)
$("#html_result").val(html.replace(/>/g, ">\n").replace(/</g, "\n<").replace(/\n{2,}/g, "\n\n"));
});
var sample = "#### Underscores\nthis should have _emphasis_\nthis_should_not\n_nor_should_this\n\n\
View csvParser.html
<html>
<head>
<script>
// Check for the various File API support.
if (window.File && window.FileReader && window.FileList && window.Blob) {
// Great success! All the File APIs are supported.
} else {
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Holy Grail</title>
<style>
/* some basic styles. nothing to do with flexbox */
header, footer,
nav, article, aside {
border: 1px solid black;
@talamaska
talamaska / maintain-ratio.scss
Created Feb 12, 2016 — forked from brianmcallister/maintain-ratio.scss
Sass mixin for a responsive box that maintains an aspect ratio.
View maintain-ratio.scss
// Maintain ratio mixin. Great for responsive grids, or videos.
// https://gist.github.com/brianmcallister/2932463
//
// $ratio - Ratio the element needs to maintain.
//
// Examples
//
// // A 16:9 ratio would look like this:
// .element {
// @include maintain-ratio(16 9);
View indexed.js
/* global: indexedDB, IDBKeyRange */
// index.js
// Provides easy interaction with indexedDB
// ---
// Part of the Riggr SPA framework <https://github.com/Fluidbyte/Riggr> and released
// under the MIT license. This notice must remain intact.
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof exports === 'object') {
@talamaska
talamaska / BaseForm.ts
Created May 23, 2017 — forked from sasxa/BaseForm.ts
Angular2 Forms with @ngrx/store
View BaseForm.ts
export class _BaseForm {
_builder: FormBuilder;
_group: ControlGroup;
public controls = (value: any = {}) => ({
});
public selector: string = "examples";
public store: Store<any>;
constructor() { }
View rxjs_operators_by_example.md
View textarea-expanded-full.component.ts
import { Component, forwardRef, Renderer2, ViewChild } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
export const EPANDED_TEXTAREA_VALUE_ACCESSOR : any = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => TextareaExpandedComponent),
multi: true,
};
@Component({
View NgControlOptionsDirective.ts
import { Directive, ElementRef, forwardRef, Input, Renderer2 } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { fromEvent } from 'rxjs/observable/fromEvent';
import { merge } from 'rxjs/observable/merge';
import { timer } from 'rxjs/observable/timer';
import { Subscription } from 'rxjs/Subscription';
export const DEFAULT_VALUE_ACCESSOR : any = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => NgControlOptionsDirective),
You can’t perform that action at this time.