Skip to content

Instantly share code, notes, and snippets.

View arifhp86's full-sized avatar

Arifur Rahman arifhp86

View GitHub Profile
@arifhp86
arifhp86 / custom-domain-localhost-xampp
Created July 6, 2016 01:48 — forked from oozman/custom-domain-localhost-xampp
How to add a custom domain name on your localhost using XAMPP. Codes are based on Windows, but Step 2 onwards are pretty much applicable on other operating system.
Step 1:
Go to: C:\Windows\System32\Drivers\etc\hosts
And add this to the bottom of the file:
=============
127.0.0.1 your.domain.com
=============
Step 2:
Go to [your XAMPP directory]/apache/conf/httpd-xampp.conf
/**
* This will open new fiverr window every 10 minutes
* and close that window after 8 minutes
*/
var newWindow, nthTime = 0;
setInterval(() => {
newWindow = window.open('http://www.fiverr.com');
console.log('Refreshed ' + (++nthTime) + ' time');
setTimeout(() => { newWindow.close() }, 1000 * 60 * 8);
@arifhp86
arifhp86 / scopes.txt
Created January 31, 2016 22:15 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
function uniq(a) {
return a.sort().filter(function(v, i, a) {
return !i || v != a[i - 1];
});
}
Got a smart way
function uniq(arr) {
return arr.filter((v,i,a) => a.indexOf(v)===i);
<html><head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
function tally (selector) {
$(selector).each(function () {
var total = 0,
column = $(this).siblings(selector).andSelf().index(this);
$(this).parents().prevUntil(':has(' + selector + ')').each(function () {