Skip to content

Instantly share code, notes, and snippets.

View Flamefork's full-sized avatar

Ilia Ablamonov Flamefork

View GitHub Profile
@Flamefork
Flamefork / mesh-problem.sh
Created October 13, 2023 19:46
mesh-primitives-problem
#!/bin/bash
cd ~
mkdir mesh
cd mesh
cat <<EOF > package.json
{
"scripts": {
"dev": "mesh dev"
},
class C45b < Formula
desc "Tool for communicating with the Chip45 AVR bootloader"
homepage "https://github.com/bullestock/c45b"
head "https://github.com/bullestock/c45b.git"
depends_on "qt@4" => :build
def install
system "qmake", "PREFIX=#{prefix}"
system "make"

Keybase proof

I hereby claim:

  • I am flamefork on github.
  • I am flamefork (https://keybase.io/flamefork) on keybase.
  • I have a public key ASB6DJeDWcCwKKg7rWlnOHKWPBgBh1Ze4NvJnYYaGaxRHgo

To claim this, I am signing this object:

@Flamefork
Flamefork / React.addons.tagHelper.js
Last active January 4, 2016 00:08
React addon for easier React.DOM building without JSX
//
// React addon for easier React.DOM building without JSX
//
// Usage:
//
// render: function () {
// return React.addons.tagHelper(
// ['#main.container',
// ['h1', 'Hello!'],
// ['a.andClass.andAnother', { href: '/' }, 'Home']]
@Flamefork
Flamefork / react_widje.cljs
Created October 4, 2013 13:59
Facebook's React Tutorial implemented using Widje
(def converter (Showdown.converter.))
(defwidjet comment [c]
[:div.comment
[:h2.commentAuthor (:author c)]
[:span (raw (.makeHtml converter (:text c)))]])
(defwidget comment-list [comments]
[:div.commentList
(map comment comments)])
@Flamefork
Flamefork / convert_restkit_params.rb
Created October 31, 2012 18:18
Convert php-style nested attribute arrays to rails-style. Dirty hack.
# put this into config/initializers
module Rack
module Utils
def parse_nested_query_with_restkit(qs, d = nil)
qs = RestkitConverter.new.convert(qs) if qs[/\[\]/]
parse_nested_query_without_restkit(qs, d)
end
alias_method_chain :parse_nested_query, :restkit
module_function :parse_nested_query
-module(persistent_jobs).
-behavior(e2_service).
-behavior(e2_task).
-export([start/3]).
-export([start_link/1]).
-export([init/1, handle_msg/3]).
-export([handle_task/1]).
@Flamefork
Flamefork / ffmpeg.rb
Created December 27, 2011 22:21
ffmpeg & carrierwave
module CarrierWave
module FFMPEG
extend ActiveSupport::Concern
module ClassMethods
def faststart
process :faststart => true
end
def transcode options
@Flamefork
Flamefork / set_column_type.rb
Created July 27, 2011 08:58
[ActiveRecord 3] Support for custom column definitions
module SetColumnType
extend ActiveSupport::Concern
included do
class_attribute :custom_column_definitions
def self.set_column_type name, type
raise "Definition for column '#{name}' already exists" if (columns_hash rescue {})[name.to_s].present?
(self.custom_column_definitions ||= {})[name.to_s] = ActiveRecord::ConnectionAdapters::Column.new name, nil, type
end
@Flamefork
Flamefork / gist:771230
Created January 8, 2011 23:07
Queryl
/*
Usage examples
*/
// select * from users where active = true and last_logged_in > '2010-12-01' and type in ('admin, 'moderator') and expires > now() limit 1
table('users').
where({active: true}).
where({'last_logged_in >': new Date(2010, 12, 1)}).
where({type: ['admin', 'moderator']}).
where('expires > now()').