Skip to content

Instantly share code, notes, and snippets.

View askucher's full-sized avatar
💭
I may be slow to respond.

Andrey askucher

💭
I may be slow to respond.
  • Kiev
View GitHub Profile
@askucher
askucher / LivescriptToJavascriptConverter
Created August 11, 2013 14:06
Livescript To Javascript converter.NET Required Jurassic.dll livescript.js (another file)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jurassic;
using System.Reflection;
using System.Resources;
using System.IO;
namespace PE.Helpers
@askucher
askucher / angular-strap-modal.coffee
Last active December 23, 2015 16:09
Angularstrap modal directive for bootstrap 3
"use strict"
angular.module("$strap.directives").factory("$modal", ["$rootScope", "$compile", "$http", "$timeout", "$q", "$templateCache", "$strapConfig", ($rootScope, $compile, $http, $timeout, $q, $templateCache, $strapConfig) ->
ModalFactory = ModalFactory = (config) ->
Modal = (config) ->
options = angular.extend(
show: true
, $strapConfig.modal, config)
scope = (if options.scope then options.scope else $rootScope.$new())
templateUrl = options.template
$q.when($templateCache.get(templateUrl) or $http.get(templateUrl,
@askucher
askucher / null-safe-prelude-ls
Created September 26, 2013 13:06
Null Safe Prelude
const p = require \prelude-ls
const safe = (a, b, c) --> if c? then c |> p.filter (?) |> a b
module.exports =
each : safe p.each
map : safe p.map
compact : safe p.compact
filter : safe p.filter
reject : safe p.reject
@askucher
askucher / preludels
Created October 6, 2013 16:19
RequireJS + PreludeLS
define([], function() {
require=(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({"prelude-ls":[function(require,module,exports){
module.exports=require('bcmc1g');
},{}],"bcmc1g":[function(require,module,exports){
// Generated by LiveScript 1.2.0
var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString;
Func = require('./Func.js');
List = require('./List.js');
Obj = require('./Obj.js');
@askucher
askucher / http.hs
Created October 17, 2013 07:38
JSON RESTful Http (GET,POST) client on haskell
module Http(get,post) where
import Network.Socket
--import Network.HTTP
import Network.HTTP.Conduit
import Network.HTTP.Types.Method
import Network.HTTP.Types.Header
--import Control.Monad
--import Control.Applicative
import qualified Data.ByteString.Lazy.Char8 as C
@askucher
askucher / SassMeister-input-HTML.haml
Created October 30, 2013 09:13
Generated by SassMeister.com.
%span.required.angle
%input
@askucher
askucher / SassMeister-input-HTML.haml
Created November 4, 2013 14:40
Generated by SassMeister.com.
%span.required
%input
@askucher
askucher / sass2scss.js
Last active December 27, 2015 18:09
Trick which allow to convert SASS to SCSS
function indentToBraces(input){
var p = require("prelude-ls"); //http://preludels.com/
var lines, i, idx, j, braces, bracesString;
if (input != null) {
lines = p.map(function(it){
var m;
m = it.match(/^\s+/);
return {
i: m != null ? m[0].length : 0,
c: it
@askucher
askucher / reactive-examples.ls
Last active December 30, 2015 00:39
Reactive framework for nodejs. Made for simple things lovers.
const p = require \./reactive.js
######
# Benefits:
# Do not care about when it will be executed
# You can return simple result or promise of result
######
#Simple example:
@askucher
askucher / reactive-examples.js
Last active December 30, 2015 01:29
Reactive framework for nodejs. Made for simple things lovers. (Javascript example)
var p = require ('reactive.js')
/*
Benefits:
Do not care about when it will be executed
You can return simple result or promise of result
*/
//Simple example: