Skip to content

Instantly share code, notes, and snippets.

View dr-dimitru's full-sized avatar
👨‍💻
get 💩 done

dr.dimitru dr-dimitru

👨‍💻
get 💩 done
View GitHub Profile
@siraj
siraj / build-essential.sh
Created November 28, 2011 05:56 — forked from henry0312/build-essential.sh
Build m4, autoconf, automake, libtool on Mac OS X Lion
#!/bin/sh
# 初期設定
WORK=$HOME/Builds/build-essential
PREFIX=$HOME/local
export PATH="$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
# ソースコードのダウンロード
if [ ! -d $WORK/src ] ; then
mkdir src
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@jasonrhodes
jasonrhodes / getProperty.js
Created April 6, 2012 17:40
Get a nested object property by passing a dot notation string as the property name
/**
* A function to take a string written in dot notation style, and use it to
* find a nested object property inside of an object.
*
* Useful in a plugin or module that accepts a JSON array of objects, but
* you want to let the user specify where to find various bits of data
* inside of each custom object instead of forcing a standardized
* property list.
*
* @param String nested A dot notation style parameter reference (ie "urls.small")
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@kyledecot
kyledecot / laravel-ujs.js
Created June 19, 2012 14:40
laravel UJS
(function($, undefined) {
// Shorthand to make it a little easier to call public laravel functions from within laravel.js
var laravel;
$.laravel = laravel = {
// Link elements bound by jquery-ujs
linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]',
// Select elements bound by jquery-ujs
inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
@dr-dimitru
dr-dimitru / index.html
Last active April 18, 2016 01:53
Blinking cursor | Safari, FF, Opera, Chrome - 100% support | Example here: http://ostr.io
<html>
<head>
<style>
span.cursor {
-webkit-animation: blink 2s steps(1) infinite;
-moz-animation: blink 2s steps(1) infinite;
-ms-animation: blink 2s steps(1) infinite;
-o-animation: blink 2s steps(1) infinite;
animation: blink 2s steps(1) infinite;
}
@dr-dimitru
dr-dimitru / Social RESTful URLs snippet.md
Last active January 28, 2023 03:57
Social links, +1s and shares using only HTML (no JS)
@dr-dimitru
dr-dimitru / css-browser-specific.md
Last active December 26, 2015 15:19
CSS browser specific targets selector, rules, statements and pseudo-classes

Opera:

[Docs for > Opera 9.5 ][1]

doesnotexist:-o-prefocus, .example {
    /*The following will apply rules to 'example' class in Opera only.*/
}

Firefox:

@dr-dimitru
dr-dimitru / simplest-nodejs-nginx-config.conf
Created October 28, 2013 00:49
Simplest way for Nginx as Node.js reverse proxy [CONFIG]
server {
listen 80;
server_name domain.com;
location / {
proxy_pass http://mystream;
proxy_set_header Host $http_host;
}
}
@umidjons
umidjons / sort-object-properties-by-value.md
Last active January 16, 2024 13:00
JavaScript: sort object properties by value (numeric or string)

Sort object properties by value (values are text)

I have following object:

var cities={10:'Tashkent', 14:'Karakalpakiya', 16:'Andijan'};

I want sort it by city names, so after sort it should be:

var cities={16:'Andijan', 14:'Karakalpakiya', 10:'Tashkent'};

But I can't sort object properties, instead can convert object into array, then sort items.