Skip to content
from schematics.models import Model
from schematics.types import BaseType, StringType, BooleanType, IntType
from schematics.types.compound import ListType, ModelType as _ModelType, DictType
from schematics.transforms import blacklist, export_loop
import ruamel.yaml as yaml
from ruamel.yaml.comments import CommentedMap
from ruamel.yaml.scalarstring import PreservedScalarString
from ruamel.yaml.compat import string_types, ordereddict
View common.js
import {isArray, cloneDeep} from 'lodash'
export class ExtendableError extends Error {
constructor(message) {
super(message) =
this.message = message
class SimpleEventEmitter:
_events: []
_onceWrapper: (type) ->
wrapper = ~>
@off(type, wrapper)
fn.apply(this, arguments)
on: (type, fn, once=false) !->
@_events[type] = @_events[type]? or []
View findfilehosttest.js
var url = $("script[src$='findfilehosttest.js']").attr('src')
var matches = url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i)
var domain = matches && matches[1]
View request.php
function R($param, $default=null, $type='string') {
return $default;
$r = $_REQUEST[$param];
if($type === 'bool' || $type === 'boolean') {
if($r === 'false' || $r === 'no')
return false;
return !empty($r);
settype($r, $type);
View nearSort.js
function nearestInList(number, list, returnDistance) {
var distance = Infinity;
var n = null;
for(var i in list) {
var _distance = Math.abs(list[i] - number);
if(_distance < distance) {
distance = _distance;
n = list[i];
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View exchange-rates.php
$xml_url = '';
$data = simplexml_load_file($xml_url);
$out = array(
'timestamp' => time(),
'base' => 'ISK',
'rates' => array()
# -*- coding: utf-8 -*-
from django.utils import unittest
from django.test.client import Client
import simplejson as json
import hashlib
from settings import PROJECT_PATH
from main.models import Event
#! /usr/bin/python
import os
import re
in_log_path = '/var/log/apache2/clickheat/'
out_log_path = '/var/www/clickheat/logs/'
site_files = []
Something went wrong with that request. Please try again.