Skip to content

Instantly share code, notes, and snippets.

View DonKoko's full-sized avatar
🏄‍♂️
...

Nikolay Bonev DonKoko

🏄‍♂️
...
View GitHub Profile
@DonKoko
DonKoko / route.tsx
Created March 27, 2023 16:18 — forked from rphlmr/route.tsx
Remix Supabase Upload
// if you don't plan to upload only images :
/*
async function convertToFile(data: AsyncIterable<Uint8Array>) {
const chunks = [];
for await (const chunk of data) {
chunks.push(chunk);
}
return chunks;
}
var Meter = function (props) {
var {
percent = 0, // a number between 0 and 1, inclusive
width = 100, // the overall width
height = 10, // the overall height
rounded = true, // if true, use rounded corners
color = "#0078bc", // the fill color
animate = false, // if true, animate when the percent changes
label = null // a label to describe the contents (for accessibility)
} = props;
@DonKoko
DonKoko / development.rb
Created January 23, 2020 16:06 — forked from ryanb/development.rb
Some rack middleware to add headers to asset pipeline.
class AssetHeaders
def initialize(app)
@app = app
end
def call(env)
request = Rack::Request.new(env)
response = @app.call(env)
if request.path =~ /^\/assets\//
# there maybe a better way to add headers
// Shortcode for showing job categories
function dm_display_wpjm_categories () {
$terms = get_terms( array('taxonomy' => 'job_listing_category',
'hide_empty' => false,));
// begin output buffering
ob_start();
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
echo '<ul class="job-categories-wrapper">';
class ChangeFkTournamentSeasons < ActiveRecord::Migration
def change
rename_column :tournament_seasons, :license_id, :licence_id
end
end
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/try.rb:77:in `public_send'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/try.rb:77:in `try!'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/try.rb:63:in `try'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/bundler/gems/steam-87c853571f8a/lib/locomotive/steam/models/associations/referenced.rb:50:in `method_missing'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/bson-4.2.1/lib/bson/hash.rb:44:in `block in to_bson'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/bson-4.2.1/lib/bson/hash.rb:43:in `each'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/bson-4.2.1/lib/bson/hash.rb:43:in `to_bson'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/bson-4.2.1/lib/bson/hash.rb:46:in `block in to_bson'
/
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/try.rb:77:in `public_send'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/try.rb:77:in `try!'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/try.rb:63:in `try'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/bundler/gems/steam-87c853571f8a/lib/locomotive/steam/models/associations/referenced.rb:50:in `method_missing'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/bson-4.2.1/lib/bson/hash.rb:44:in `block in to_bson'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/bson-4.2.1/lib/bson/hash.rb:43:in `each'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/bson-4.2.1/lib/bson/hash.rb:43:in `to_bson'
/var/deploy/station_do/web_head/shared/bundle/ruby/2.2.0/gems/bson-4.2.1/lib/bson/hash.rb:46:in `block in to_bson'
/
BACKTRACE
/Users/Donkoko/.rvm/gems/ruby-2.3.1/gems/locomotivecms-solid-4.0.1/lib/solid/parser/ripper.rb:22:in `dive_in'
/Users/Donkoko/.rvm/gems/ruby-2.3.1/gems/locomotivecms-solid-4.0.1/lib/solid/parser/ripper.rb:14:in `parse'
/Users/Donkoko/.rvm/gems/ruby-2.3.1/gems/locomotivecms-solid-4.0.1/lib/solid/parser/ripper.rb:4:in `parse'
/Users/Donkoko/.rvm/gems/ruby-2.3.1/gems/locomotivecms-solid-4.0.1/lib/solid/parser.rb:103:in `parse'
/Users/Donkoko/.rvm/gems/ruby-2.3.1/gems/locomotivecms-solid-4.0.1/lib/solid/arguments.rb:15:in `parse!'
/Users/Donkoko/.rvm/gems/ruby-2.3.1/gems/locomotivecms-solid-4.0.1/lib/solid/arguments.rb:5:in `parse'
/Users/Donkoko/.rvm/gems/ruby-2.3.1/gems/locomotivecms-solid-4.0.1/lib/solid/element.rb:10:in `initialize'
/Users/Donkoko/.rvm/gems/ruby-2.3.1/gems/locomotivecms_steam-1.3.0.rc1/lib/locomotive/steam/liquid/tags/with_scope.rb:36:in `initialize'
@DonKoko
DonKoko / Grey
Last active May 26, 2017 14:04
Code snippets for different headers
header#main-header, .et-fixed-header {
-webkit-box-shadow:none !important;
-moz-box-shadow:none !important;
box-shadow:none !important;
background-color: #f6f5fb !important;
}
@DonKoko
DonKoko / action.liquid
Created March 17, 2017 15:02
filtering
{% action "Filter gemeente entries" %}
// Get the current municipality(scope of the page)
var municipality = getProp("municipality");
// Get the name of the current category for the breadcrumbs
var category_query = getProp('params.category_query');
setProp('category_query', category_query);