Skip to content

Instantly share code, notes, and snippets.

View goshacmd's full-sized avatar

Gosha Spark goshacmd

View GitHub Profile
@jodosha
jodosha / lotus_model.rb
Last active October 13, 2016 10:33
Full working example of Lotus::Model
require 'bundler/setup'
require 'lotus/model'
require 'lotus/model/adapters/sql_adapter'
require 'sqlite3'
connection_uri = "sqlite://#{ __dir__ }/test.db"
database = Sequel.connect(connection_uri)
database.create_table! :articles do
primary_key :id
@alyssais
alyssais / async.rb
Created April 7, 2014 12:27
A Ruby implementation of a waterfall control flow thingy.
module Async
class << self
def waterfall(objects, handler, &block)
enumerator = objects.each
prev_result = nil
run_next = lambda do
begin
# onwards!
prev_result = handler.(enumerator.next, prev_result) do |success|
success ? run_next.call : block.(false)
@jodosha
jodosha / Gemfile
Last active December 9, 2020 15:09
Full stack Lotus application example
source 'https://rubygems.org'
gem 'rake'
gem 'lotus-router'
gem 'lotus-controller'
gem 'lotus-view'
group :test do
gem 'rspec'
gem 'capybara'
@lukehoban
lukehoban / es6features.md
Last active December 6, 2019 01:50
ECMAScript 6 Features

Note: Up to date version now at https://github.com/lukehoban/es6features

ECMAScript 6

Introduction

ECMAScript 6 is the upcoming version of the ECMAScript standard. This standard is targetting ratifcation in December 2014. ES6 is a significant update to the language, and the first update to the language since ES5 was standardized in 2009. Implementation of these features in major JavaScript engines is underway now.

See the draft ES6 standard for full specification of the ECMAScript 6 language.

ES6 includes the following new features:

@callumacrae
callumacrae / build-tools.md
Last active October 25, 2023 15:14
Build tools written in JavaScript
@joernchen
joernchen / bounty.txt
Created February 22, 2014 16:17
Bounty writeup
GitHub RCE by Environment variable injection Bug Bounty writeup
Disclaimer: I'll keep this really short but I hope you'll get the key points.
GitHub blogged a while ago about some internal tool called gerve:
https://github.com/blog/530-how-we-made-github-fast
Upon git+sshing to github.com gerve basically looks up your permission
on the repo you want to interact with. Then it bounces you further in
another forced SSH session to the back end where the repo actually is.
@BashedCrab
BashedCrab / JumpyOctopus.py
Created February 12, 2014 03:25
JumpyOctopus
from scene import *
from PIL import Image
import sound
import random
GAME_READY = 0
GAME_PLAY = 1
GAME_DYING = 2
GAME_DEAD = 3
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 20, 2025 13:11
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@harith
harith / shellmarks.sh
Last active September 18, 2022 07:50
Utilities to let you easily reach frequently visited but deeply nested directories.
# Utilities for quickly accessing frequently used directories in bash.
# Usage:
# $ cd /path/to/project/src/
# $ mark code # Will create a new shortcut.
# # Becomes interactive if a shortcut already exists
# # m is an alias for mark. You can also `m code`
#
# $ code # From now on, running this anywhere in the shell
# # will put you in /path/to/project/src/code
# Ember defines function() {}.property() as a shortcut
# for making computed properties
name: (->
@get('firstName') + " " + @get('lastName')
).property('firstName', 'lastName')
# It is a shortcut to wrapping the function inside
# Em.computed. However, using the "long way" is
# actually a bit nicer in coffeescript due to not
# requiring the parentheses