Skip to content

Instantly share code, notes, and snippets.

View azizur's full-sized avatar

Azizur Rahman azizur

View GitHub Profile
@Conrad777
Conrad777 / _overwrite-floats.scss
Last active April 28, 2017 12:40
Twitter Bootstrap grid: Replace floats with inline-block display and add utility classes (.vertical-align-top, .vertical-align-bottom, .vertical-align-middle) for vertical alignment. Import file after Bootstrap imports.
// replace floats with inline-block
%set-inline-block {
float: none;
display: inline-block;
margin: 0 -0.125em;
vertical-align: top;
}
@mixin replaceFloatloop($class) {
@for $i from 1 through 12 {
@yamionp
yamionp / locustfile.py
Last active March 27, 2025 01:51
Websocket Locust Sample. locustfile and Echo/Chat Server
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import json
import uuid
import time
import gevent
#!/bin/sh
#
# Adam Sharp
# Aug 21, 2013
#
# Usage: Add it to your PATH and `git remove-submodule path/to/submodule`.
#
# Change to a directory that’s in your PATH, I used /usr/local/bin and run the following commands:
#
# $ curl -o git-remove-submodule https://gist.githubusercontent.com/azizur/10c814ae16a9d75d4e42/raw/fa7b5e9c30a0118d51625dd038e363aceefd382c/git-remove-submodule
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@Eyal-Shalev
Eyal-Shalev / scroller.js
Last active September 6, 2015 19:47 — forked from dezinezync/scroll.easing.js
Vanilla Javascript scrolling object
'use strict';
/*
* Based on work done by Nikhil Nigade (@dezinezync) https://gist.github.com/dezinezync/5487119
*/
(function () {
var DEFAULT_ELEMENT = document.documentElement.scrollTop ? document.documentElement : document.body;
var REQUEST_ANIMATION_FRAME = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame || window.oRequestAnimationFrame;
@ReedD
ReedD / ec2-startup.sh
Last active December 30, 2024 20:52
User data for EC2 to set up Docker and Compose (Fig) for ec2-user
#!/bin/sh
export PATH=/usr/local/bin:$PATH;
yum update
yum install docker -y
service docker start
# Docker login notes:
# - For no email, just put one blank space.
# - Also the private repo protocol and version are needed for docker
# to properly setup the .dockercfg file to work with compose
@flangofas
flangofas / ConvertMS.js
Last active March 28, 2025 14:13
JS: Convert Milliseconds to days? minutes? seconds? or all!
function convertMiliseconds(miliseconds, format) {
var days, hours, minutes, seconds, total_hours, total_minutes, total_seconds;
total_seconds = parseInt(Math.floor(miliseconds / 1000));
total_minutes = parseInt(Math.floor(total_seconds / 60));
total_hours = parseInt(Math.floor(total_minutes / 60));
days = parseInt(Math.floor(total_hours / 24));
seconds = parseInt(total_seconds % 60);
minutes = parseInt(total_minutes % 60);
package controllers
import play.api._
import play.api.mvc._
import play.api.libs.json.JsValue
import play.api.data.Form
import play.api.data.Forms._
import play.api.data.format.Formats._
import play.api.data.validation.Constraints._
import models.Credential
@colthreepv
colthreepv / mock-delay.js
Last active December 25, 2015 23:19
AngularJS mocked backend demonstration, step-2
angular.module('appMock', ['ngMockE2E'])
.factory('delayHTTP', function ($q, $timeout) {
return {
request: function (request) {
var delayedResponse = $q.defer();
$timeout(function () {
delayedResponse.resolve(request);
}, 500);
return delayedResponse.promise;
},