hexsha stringlengths 40 40 | size int64 5 129k | content stringlengths 5 129k | avg_line_length float64 4 98.3 | max_line_length int64 5 660 | alphanum_fraction float64 0.25 0.98 |
|---|---|---|---|---|---|
9a6a5afda623bde4252878fd3c78df1f2e7a79e5 | 4,010 | export ^
require "states/scenes/scenestate"
require "timer"
require "states/transitions/fadetoblack"
require "states/transitions/fadefrom"
class FinderSceneState extends SceneState
new: (scene, fulltext, @clues_to_find, @startIndices, @stopIndices) =>
super(scene)
-- @timer = CigTimer() -- should ... | 41.340206 | 130 | 0.572319 |
cde1bd40493c48e2cc62afbeece841066daf3e65 | 1,655 | uri_patts = require 'lpeg_patterns.uri'
Incoming = require 'quest.incoming'
Outgoing = require 'quest.outgoing'
util = require 'http.util'
lpeg = require 'lpeg'
cq = require 'cqueues'
EOF = lpeg.P -1
uri_patt = uri_patts.uri * EOF
if rawget(_G, '_DEV') == true
new = Outgoing
Outgoing = (...) ->
ok, req = dbg.... | 25.461538 | 63 | 0.650151 |
0d7a0e6749b82f163e27d45e2fb42b1463d86e66 | 845 | import List from require "LunoPunk.utils.List"
class eventlistener
new: =>
@__listeners = {}
add: (type, f) =>
@__listeners[type] = List! if @__listeners[type] == nil
@__listeners[type]\push f
remove: (type, f) =>
if f == nil
@__listeners[type] = nil
return nil
l = @__listeners[type]
return nil... | 23.472222 | 96 | 0.661538 |
0349bd6e8570f670e86e9b9db140f847aa943c27 | 940 | ----------------------------------------------------------------
-- A table @{Block} that is not assigned to any variable.
-- Useful to have a table within a @{TableBlock}.
--
-- @classmod AnonymousTableBlock
-- @author Richard Voelker
-- @license MIT
----------------------------------------------------------------
lo... | 22.380952 | 64 | 0.579787 |
0eff48b1196aa62c1ef326e936e4d0260423af60 | 1,383 | ----------------------------------------------------------------
-- A @{Block} that is similar to to @{TableBlock} but assigns
-- the table to a table key instead of a local variable.
--
-- @classmod TableAssignmentBlock
-- @author Richard Voelker
-- @license MIT
--------------------------------------------------------... | 26.596154 | 65 | 0.545915 |
09763c5560ec1214b8a8cd56ac8e39827b486895 | 28,031 | config = require "lapis.config"
config.default_config.postgres = {backend: "pgmoon"}
config.reset true
db = require "lapis.db.postgres"
import Model from require "lapis.db.postgres.model"
import stub_queries, assert_queries from require "spec.helpers"
describe "lapis.db.model.relations", ->
get_queries, mock_query ... | 24.653474 | 108 | 0.556277 |
6e43f1321ca1e18859f380a787a7f5b59e8d8262 | 1,802 | import unpack, type from _G
import byte, char from string
import concat from table
import BYTE_MAXIMUM_VALUE, BYTE_MINIMUM_VALUE from "noomlib/io/buffer/constants"
-- table allocate(number size)
-- Returns a preallocated table
export allocate = (size) ->
return [-1 for _=1, size]
-- table bytes_from_string(strin... | 33.37037 | 112 | 0.666482 |
bbf54f8928531c32c912a88cb7ba5c8d2a80805c | 406 | class RedMode
new: =>
@api = bundle_load 'api'
@lexer = bundle_load 'red_lexer'
@completers = { 'in_buffer', 'api' }
comment_syntax: ';'
word_pattern: '[%w%?%-%!_~%*+/<>=]+'
auto_pairs: {
'(': ')'
'[': ']'
'{': '}'
'"': '"'
}
indentation: {
more_after: {
r'[({=\\[]\\... | 14.5 | 40 | 0.371921 |
477aada27de47912f6d2d85602b89a2b5dab0705 | 10,980 | api = vim.api
loop = vim.loop
Utils = require'neotags/utils'
class Neotags
new: (opts) =>
@opts = {
enable: true,
ft_conv: {
['c++']: 'cpp',
['moonscript']: 'moon',
['c#']: 'cs',
},
ft_map: {
cp... | 30.082192 | 100 | 0.473862 |
26cf314792a560b8568cf3e9ef746b6589c7b311 | 14,193 | -- Copyright 2012-2015 The Howl Developers
-- License: MIT (see LICENSE.md at the top-level directory of the distribution)
Gtk = require 'ljglibs.gtk'
import bindings, dispatch, interact, signal from howl
import Matcher from howl.util
import PropertyObject from howl.aux.moon
import TextWidget, NotificationWidget, Indi... | 27.884086 | 106 | 0.663919 |
2b5264651951cc1c9fe1b5d56f8670006df81ad5 | 322 | -- Copyright 2014-2015 The Howl Developers
-- License: MIT (see LICENSE.md at the top-level directory of the distribution)
howl.util.lpeg_lexer ->
coffeescript = sequence {
line_start,
#any('\t', P(' ')^4),
sub_lex_match_time('coffeescript', scan_through_indented!)
}
compose 'markdown', coffeescrip... | 24.769231 | 79 | 0.704969 |
8b2ce7fcd50cf10dce7f709153ab9d6be4543039 | 559 | {
whitelist_globals: {
["spiders.moon"]: {
"btn", "btnp",
"clip",
"cls",
"circ", "circb",
"elli", "ellib",
"exit",
"fget", "fset",
"font",
"key",
"keyp",
"line",
"map",
"memcpy",
"memset",
"mget", "mset",
"mouse",
"music",
"... | 14.333333 | 23 | 0.36136 |
05c95acf77e3022b6541dff8674dc4e9e571e0c6 | 5,818 | #!/usr/bin/env moon
--- Class for handling users.
-- @author ChickenNuggers
-- @classmod client
import line_pattern, hash, serialize_tag_value from require "potato.util"
import context_from_pair from require "potato.tls"
state = require "potato.state"
wire_responses = {
[401]: ":No suck nick/channel"
[402]: ":No su... | 34.426036 | 76 | 0.673427 |
939ad38b98bd55c32770095444508f12d8c91189 | 1,661 | [[
joli-lune
small framework for love2d
MIT License (see licence file)
]]
System = require "src.systems.system"
class Particle extends System
__tostring: => return "particle"
onCreate: (color,exp,particleType,options={}) =>
@\cron "after", exp, ->
@entity.scene\removeEntity(@entity)
@expire = exp
if typ... | 29.140351 | 113 | 0.695364 |
8ca81a7b873111eb1748628705e321362494ae00 | 5,619 | {:delegate_to} = howl.util.table
background = '#282a36'
current = '#44475a'
selection = '#44475a'
foreground = '#f8f8f2'
comment = '#6272a4'
red = '#ff5555'
orange = '#ffb86c'
yellow = '#f1fa8c'
green = '#50fa7b'
aqua = '#8be9fd'
blue = '#8be9fd'
purple ... | 17.079027 | 59 | 0.589607 |
f43fd0713ffe5d5f0f704de5686b2b3ea0f4461b | 2,269 | Atom = require 'ljglibs.gdk.atom'
GtkClipboard = require 'ljglibs.gtk.clipboard'
{:clipboard, :config} = howl
describe 'Clipboard', ->
system_cb = GtkClipboard.get(Atom.SELECTION_CLIPBOARD)
before_each -> clipboard.clear!
describe 'push(item, opts = {})', ->
context 'when <item> is a string', ->
it... | 34.907692 | 85 | 0.643896 |
f9620b8f3803049046a2f869dff7aa864b70bd46 | 272 | export modinfo = {
type: "command"
desc: "Set time of day"
alias: {"settimeofday"}
func: (Msg,Speaker) ->
light = Service"Lighting"
light.TimeOfDay = Msg
Output2(string.format("Set time of day to %s",light.TimeOfDay),{Colors.Green})
loggit("Set time of day")
} | 27.2 | 80 | 0.680147 |
3fb7b6b21fc8b6717cf2517d0d7d071fd81a359a | 223 | import Model from require "lapis.db.model"
class ResourceReports extends Model
-- Has created_at and modified_at
@timestamp: true
@relations: {
{"resource", belongs_to: "Resources", key: "resource"}
} | 27.875 | 57 | 0.686099 |
b93b7cf9c98c44ad94883cda2dfc6d2a78ee8049 | 183 | cons => nil => array =>
length = (get array "length")
(for 0 length nil i => result =>
idx = (sub (sub length i) 1)
val = (get array (nts idx))
(cons idx val result))
| 26.142857 | 34 | 0.557377 |
3df96d74d412b09cd57cfc089cfdfe4332e2a873 | 2,239 |
import insert from table
validate_functions = {
exists: (input) ->
input and input != "", "%s must be provided"
-- TODO: remove this in favor of is_file
file_exists: (input) ->
type(input) == "table" and input.filename != "" and input.content != "", "Missing file"
min_length: (input, len) ->
#to... | 27.304878 | 96 | 0.601608 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.