Skip to content

Instantly share code, notes, and snippets.

@bekzod
bekzod / application.controller.js
Last active March 22, 2021 08:58 — forked from ruz/application.controller.js
prevent form submit on enter key
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
actions: {
prevent(e) {
console.log("here we are");
e.preventDefault();
return false;
},
@bekzod
bekzod / google-maps-marker.js
Created October 3, 2015 11:20
google maps markers custom icon
// The following example creates complex markers to indicate beaches near
// Sydney, NSW, Australia. Note that the anchor is set to (0,32) to correspond
// to the base of the flagpole.
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 10,
center: {lat: -33.9, lng: 151.2}
});
var s3 = new S3({
accessKeyId: process.env.S3_KEY,
secretAccessKey: process.env.S3_SECRET
});
{
"name": "typeahead-hacked",
"version": "0.0.1",
"main": "type-ahead-hacked.js"
}
function adriver(ph, prm, defer){
var my = this, p = ph;
if(this instanceof adriver){
if(typeof(p)=='string')p=document.getElementById(ph);
else ph=p.id;
if(!p){
if(!adriver.isDomReady)adriver.onDomReady(function(){new adriver(ph, prm, defer)});
return null
}
var async = require('async');
var ids = ['1','2','3'];
var work = function(item, cb){
setTimeout(function(){
cb(null,item);
},10);
};
var async = require('async');
var array = [];
var work = function(item, cb){
setTimeout(10,cb.bind(null,'result'));
};
async.each(array,work,function(err,res){
console.log(err,res);
var Step = require('step');
function someFunc(i, callback){
function cbWrapper(){ callback(undefined, i); }
i % 2 == 0 ? cbWrapper() : setTimeout(cbWrapper, 10);
}
Step(
function process(){
var group = this.group();
for(var i = 0; i < 10; i++){
var async = require('async');
function someFunc(i, callback){
function cbWrapper(){
callback(null, i);
}
i % 2 == 0 ? cbWrapper() : setTimeout(cbWrapper, 100);
}
var jobs = [];
@bekzod
bekzod / css_resources.md
Created August 31, 2014 11:09 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides