Skip to content

Instantly share code, notes, and snippets.

View ali-master's full-sized avatar
🎯
Focusing on Something new!

Ali Torki ali-master

🎯
Focusing on Something new!
View GitHub Profile
anonymous
anonymous / business-card-r-web_design-ciclop.markdown
Created August 8, 2016 22:50
Business Card /r/web_design -- Ciclop
@ali-master
ali-master / QueryToJSON
Last active October 7, 2016 14:08
Convert Query to JSON
// <refrence path="https://jsfiddle.net/dm1ufzz3/" />
function QueryStringToJSON(str) {
var pairs = str.split('&');
var result = {};
pairs.forEach(function (pair) {
pair = pair.split('=');
var name = pair[0]
var value = pair[1]
if (name.length)
@ali-master
ali-master / webpack.config.js
Created December 6, 2016 10:04
Webpack Config
/**
* npm install --save-dev webpack babel-loader babel-core babel-preset-{es2015,react} style-loader css-loader sass-loader
* npm install --save react react-dom
* directory folders: static, public
*/
const path = require("path");
const webpack = require("webpack");
module.exports = {
@ali-master
ali-master / timeSpanUpdater.md
Last active December 28, 2016 11:00
TimeSpanUpdater[timeago] with jQuery

TimeSpanUpdater[timeago] with jQuery

function TimeSpanUpdater(id, interval) {
    var updater = function () {
        var _this = this;
        this.interval = interval ? interval : 20000;
        this.registeredItemsArr = [];
        this.registerItem = function (element) {
            if (element && element.attr('data-timespan')) {
@jlong
jlong / SassMeister-input.scss
Created January 14, 2014 15:53
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
$sections: red, gold, orange, grey;
@each $i in $sections {
.section-#{$i} {
@jlong
jlong / jquery.preparetransition.js
Last active December 28, 2016 13:56
A new version of $(el).prepareTransition() that uses a timer instead of the poorly implemented TransitionEnd event to ensure that the 'is-transitioning' class is removed.
/**
* prepareTransition
*
* jQuery Plugin for ensuring transitions with display:none or visibility:hidden
* are in the right state until the end of the transition
*
* By John W. Long (http://wiseheartdesign.com)
* April 18, 2013
*
* Based on the prepareTransition plugin by Jonathan Snook (http://snook.ca). This version
@anchetaWern
anchetaWern / speech-recognition.js
Created May 16, 2015 09:49
speech-recognition.js
var recognition;
function startRecognition() {
recognition = new webkitSpeechRecognition();
recognition.onstart = function(event) {
updateRec();
};
recognition.onresult = function(event) {
var text = "";
for (var i = event.resultIndex; i < event.results.length; ++i) {
@ehsanahgh
ehsanahgh / one-liner-cookie-read
Last active February 28, 2017 04:55
one liner cookie read #cookie
@ryaninvents
ryaninvents / fun-with-bindings.js
Last active April 14, 2017 15:39
Use ES7 double-colon bind while still referring to original "this"
class Client {
constructor(foo) {
this.name = foo
}
}
class Message {
constructor(content) {
this.content = content
}
@dreyescat
dreyescat / README.md
Last active April 17, 2017 10:32
webpack resolve alias for relative paths

How to use webpack resolve-alias to solve relative paths.

npm install
mkdir -p src/components/Header
mv index.jsx src/components/Header
mkdir -p src/utils
mv myUtils.js src/utils
npm run build