Skip to content

Instantly share code, notes, and snippets.

View Fivell's full-sized avatar
🏠
Working from home

Igor Fedoronchuk Fivell

🏠
Working from home
View GitHub Profile
$.ajax({
type: 'POST',
url: "https://sandbox-api.didww.com/v3/orders",
data: JSON.stringify({
data: {
type: "orders",
attributes: {
allow_back_ordering: false,
items: [{
type: "did_order_items",
#template for select option, I use it to show regions and draw country flags for each city
cityOptionTpl = (obj)->
_.tpl('CitySelectOption')(obj)
#helper for rendering option
renderCityOption = (entry)->
tplRes = cityOptionTpl({it:
title : entry.title
region : entry.region
country_name : entry.country_name
@johana-star
johana-star / rocky_raccoon.csv
Last active January 14, 2017 22:24
Ruby Riddle: Why doesn't to_proc work on a refined Hash?
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 12 columns, instead of 4. in line 1.
Task ID,Type,Name,Status,Project,Context,Start Date,Due Date,Completion Date,Duration,Flagged,Notes
1,Context,Rocky Raccoon,active
1.1,Action,Now somewhere in the black mountain hills of Dakota,,,Rocky Raccoon,,,,,0,
1.2,Action,There lived a young boy named Rocky Raccoon,,,Rocky Raccoon,,,,,0,
1.3,Action,And one day his woman ran off with another guy,,,Rocky Raccoon,,,,,0,
1.4,Action,He hit young Rocky in the eye,,,Rocky Raccoon,,,,,0,
1.5,Action,Rocky didn't like that he said I'm gonna get that boy,,,Rocky Raccoon,,,,,0,
1.6,Action,So one day he walked into town,,,Rocky Raccoon,,,,,0,
1.7,Action,Booked himself a room in the local saloon,,,Rocky Raccoon,,,,,0,
1.8,Action,Rocky Raccoon checked into his room,,,Rocky Raccoon,,,,,0,
@runspired
runspired / form.html
Created May 23, 2016 13:46
How to turn off password and email/username autocomplete.
<!--
<form autocomplete="off"> will turn off autocomplete for the form in most browsers
except for username/email/password fields
-->
<form autocomplete="off">
<!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields -->
<input id="username" style="display:none" type="text" name="fakeusernameremembered">
<input id="password" style="display:none" type="password" name="fakepasswordremembered">
$.fn.select2.amd.define('select2/data/extended-ajax',['./ajax','../utils','jquery'], function(AjaxAdapter, Utils, $){
function ExtendedAjaxAdapter ($element,options) {
//we need explicitly process minimumInputLength value
//to decide should we use AjaxAdapter or return defaultResults,
//so it is impossible to use MinimumLength decorator here
this.minimumInputLength = options.get('minimumInputLength');
this.defaultResults = options.get('defaultResults');
ExtendedAjaxAdapter.__super__.constructor.call(this,$element,options);
@subfuzion
subfuzion / curl.md
Last active May 16, 2024 18:04
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

inherit_from: .rubocop_todo.yml
AllCops:
Exclude:
- 'bin/*'
- 'db/schema.rb'
- 'tmp/**/*'
- 'vendor/**/*'
RunRailsCops: true
Documentation:
Enabled: false
@claudiosanches
claudiosanches / test.php
Last active February 22, 2024 19:39
Regex for test credit card brand
<?php
// Test cards
$cards = array(
'378282246310005', // American Express
'371449635398431', // American Express
'5078601870000127985', // Aura
'5078601800003247449', // Aura
'30569309025904', // Diners Club
'38520000023237', // Diners Club
@varyonic
varyonic / gist:542c37648de91a02402a
Last active August 29, 2015 14:08
Deprecated but working version of form_buffers removed by https://github.com/activeadmin/activeadmin/pull/3486
module ActiveAdmin
module Views
class ActiveAdminForm
class DeprecatedFormBufferSubstitute
def initialize(form)
@form = form
end
def << (value)
@form.text_node value.html_safe
end
@ball-hayden
ball-hayden / README.md
Last active September 21, 2018 09:07
ActiveAdmin Bootstrap

ActiveAdmin Bootstrap

This is a rough proof of concept.

There will be broken things.

Comments are welcome.

Installation