Skip to content

Instantly share code, notes, and snippets.

# 1
App.request('init_bookworm').then =>
@user.createSession(userSession)
# 2
App.request('init_bookworm').then =>
@user.createSession userSession
# 3
App.request 'init_bookworm'
/* File: reslate.js
* Author: lunixbochs (Ryan Hileman)
* Project: http://github.com/lunixbochs/reslate
* License (MIT):
Copyright (c) 2013 Ryan Hileman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@kerbyfc
kerbyfc / patch.patch
Last active August 31, 2015 15:58
Выполнение "кастомной" бизнес-логики при рендеринге/обновлении построителя запросов
diff --git a/web/front/app/scripts/views/events/query_builder/advanced_conditions_query.coffee b/web/front/app/scripts/views/events/query_builder/advanced_conditions_query.coffee
index 768919a..b19c0fd 100644
--- a/web/front/app/scripts/views/events/query_builder/advanced_conditions_query.coffee
+++ b/web/front/app/scripts/views/events/query_builder/advanced_conditions_query.coffee
@@ -44,6 +44,7 @@ class FilterView extends App.Helpers.virtual_class(
return {
link_operator : @model.get 'link_operator'
isCommonPeriodUsed : @options.isCommonPeriodUsed
+ callbacks : @options.callbacks
formats : @formats
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import sys
__author__ = 'serebryakov'
from smtplib import SMTP
from email.mime.text import MIMEText
@kerbyfc
kerbyfc / TM front
Last active September 29, 2015 07:07
Traffic Monitor "web/front" files stats
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
CoffeeScript 382 12053 2870 39846
HTML 448 1347 651 19176
SASS 217 3510 761 12622
JSON 62 544 0 7778
CSS 4 78 17 2607
Javascript 7 232 74 1042
YAML 6 35 27 310
@kerbyfc
kerbyfc / grid.patch
Last active December 3, 2015 13:00
Fix for views/controls/grid.coffee
initialize: (o) ->
{@checkbox, @static} = o
- o.config = @config = _.result @collection, 'config'
+ o.config = @config = @getGridOptions('config')
(@config.default ?= {}).checkbox = true if @checkbox
@@ -266,16 +266,18 @@ class App.Views.Controls.ContentGrid extends App.Views.Controls.Grid
className: ->
@kerbyfc
kerbyfc / .phoenix.coffee
Created January 11, 2016 06:45
Phoenix configuration script
keys = []
###*
* Output information via notification center
* @param {Any} obj - any object
* @param {Number} duration = 5 - duration in seconds
###
log = (obj, duration = 5) ->
if obj?
msg = switch
[
{
"keys": ["g"],
"command": "dired_open_external",
"context": [
{ "key": "selector", "operator": "equal", "operand": "text.dired" },
{ "key": "setting.dired_rename_mode", "operand": false },
{ "key": "num_selections", "operator": "equal", "operand": 1 }
]
},
{
"color_scheme": "Packages/User/SublimeLinter/base16-ocean.light (SL).tmTheme",
"draw_shadows": false,
"enable_tab_scrolling": false,
"font_size": 14,
"ignored_packages":
[
],
"node_path": "/Users/kerbyfc/.nvm/versions/node/v6.0.0/bin/node",
"spacegray_tabs_font_small": true,
export function isOutdatedBrowser(lowerThan?: string): boolean {
let cssProp: string;
lowerThan = lowerThan || "";
//assign css3 property to IE browser version
if (lowerThan === "IE8" || lowerThan === "borderSpacing") {
cssProp = "borderSpacing";
} else if (lowerThan === "IE9" || lowerThan === "boxShadow") {