Skip to content

Instantly share code, notes, and snippets.

View ItangSanjana's full-sized avatar
🎯
Focusing

Itang Sanjana ItangSanjana

🎯
Focusing
View GitHub Profile
@ItangSanjana
ItangSanjana / gist:98b350c9ae9590247ff9a2e303f9d030
Last active November 22, 2019 21:40
Javascript: Problem, I solved.

Convert string into an array

const strToArr = (str = "", delimiter = " ") => String(str).split(delimiter).filter(Boolean);
strToArr(document.URL, "/"); // return an []
@ItangSanjana
ItangSanjana / commit_dates.sh
Created May 21, 2016 07:22 — forked from st3v/commit_dates.sh
Manipulate Git Commit Dates
# Setting date at commit time:
GIT_COMMITTER_DATE="Tue Feb 7 22:47:34 2012 -0800" git commit -m "Ignore stuff" --date "Tue Feb 7 22:47:34 2012 -0800"
# Changing date for historical commit:
git filter-branch --env-filter 'if [ $GIT_COMMIT = <commit-id> ]
then
export GIT_AUTHOR_DATE="Tue Feb 7 22:47:34 2012 -0800"
export GIT_COMMITTER_DATE="Tue Feb 7 22:47:34 2012 -0800"
@ItangSanjana
ItangSanjana / gist:e50b7862e9ee8f86dccd
Last active April 26, 2016 18:20
Ubuntu, Drupal, Drush & SQLite

Ubuntu, Drupal, Drush & SQLite

Install

sudo apt update
sudo apt install sqlite3 libsqlite3-dev

For PHP add:

sudo apt install php5-sqlite
@ItangSanjana
ItangSanjana / gist:98b7471cf0640512ce9f
Last active February 17, 2016 18:00
Drupal dev tools
<?php
//Prints human-readable information about a variable.
drupal_set_message('<pre>' . print_r($variable, TRUE) . '</pre>');
@ItangSanjana
ItangSanjana / Contract Killer 3.md
Last active July 18, 2018 21:30 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@ItangSanjana
ItangSanjana / gist:8afda0c6d7de39cbf1a0
Created December 21, 2014 14:31
The Infinite Loop of "I Love U" In JavaScript
//The Conditionless For
for (;;) {
console.log("\u0049 \u2665 \u0055");
}
//The Unchanging Condition
while (1 < 2) {
console.log("\u0049 \u2665 \u0055");
}
@ItangSanjana
ItangSanjana / gist:cc28cbf97081f05db517
Last active August 29, 2015 14:03
# Drupal Multi-site on Local Ubuntu Server

The Setup

  • Linux Ubuntu 14.04
  • Apache 2.4.7 + userdir_module
  • MySQL 5.5.37
  • PHP 5.5.9
  • Drupal 7x

The Directories

  • ~/public_html/foo
  • ~/public_html/bar
@ItangSanjana
ItangSanjana / gist:edadf9f0749413eae6b0
Last active August 29, 2015 14:03
HTML + JavaScript : Add class to documentElement immediately then remove it 1 sec after window loaded.
<html>
<head>
<script>document.documentElement.className += "loading";</script>
</head>
<body>
<script>
(function () {
'use strict';
function removeTheClass() {