Skip to content

Instantly share code, notes, and snippets.

View chinchang's full-sized avatar
🏠
Building cssbattle.dev

Kushagra Gour chinchang

🏠
Building cssbattle.dev
View GitHub Profile
@chinchang
chinchang / atomic-vs-oocss.html
Created March 29, 2016 18:28
Comparing code for OOCSS and Atomic CSS
<!--
Example: A simple list component with each item as a block one below other with some padding and border.
-->
<!-- Atomic CSS -->
<ul class="MB(baseSpacing) Bgc(#0280ae)">
<li class="P(halfBaseSpacing) BdB(1px)"></li>
...
</ul>
@chinchang
chinchang / angular-with-o-o.js
Created December 13, 2015 07:45
Angular like watch and directive implementation concept using Object.observe
(function () {
function getObjectFromExpression(expr) {
var splits = expr.split('.'),
obj, propertyName;
if (splits.length === 1) {
obj = window;
propertyName = splits[0];
} else {
obj = splits.slice(0, splits.length - 1).reduce(function (obj, key) {
@chinchang
chinchang / xmlToJson.js
Last active September 7, 2023 02:39
Function to convert XML to JSON
/**
* Changes XML to JSON
* Modified version from here: http://davidwalsh.name/convert-xml-json
* @param {string} xml XML DOM tree
*/
function xmlToJson(xml) {
// Create the return object
var obj = {};
if (xml.nodeType == 1) {
@chinchang
chinchang / react-with-unknown-attributes.js
Last active September 15, 2016 09:22
Make ReactJS work with unknown attributes
/**
*
* PATCH to make React work with custom attributes.
*
*/
HTMLDOMPropertyConfig.isCustomAttribute = function(attr) {
// Strip off custom attributes React puts for its working.
if ({children: 1}[attr]) { return false; }
// Take any attribute (with correct syntax) as custom attribute.
@chinchang
chinchang / how-tos.md
Last active August 29, 2015 14:07
How tos

System

  • Enable SSL on charles and getting 403 Forbidden? Change the following directive in httpd-ssl.conf:
SSLStrictSNIVHostCheck off
@chinchang
chinchang / routine.markdown
Last active August 29, 2015 14:04
My planned routine for the next one month

Routine from 21-July-2014

This will be something I have not done since my school times - getting up early.

  • 6.00 AM: Get up
  • 6.20 AM: Leave for park with a Football. I'll practise juggling this whole month.
  • 7.20 - 6.35 AM: Get back home and do pranayaam.
  • 7.35 - 7.45 AM - Relax.
  • 7.45 AM (8.12 AM) - Take bath.
  • 8 AM (8.30 AM) - Have breakfast.
@chinchang
chinchang / gist:4666645
Last active December 11, 2015 21:59
Make your screen wobble!
/**
* Run this in your developer console on a website with jQuery on it
*/
(function(){$('head').append('<link type="text/css" rel="stylesheet" href="http://daneden.me/animate/animate.css">');
var d=$('div'),i=d.length;while(i--){
(function(){
var e=d[i];
setTimeout(function() { $(e).addClass('animated wobble'); }, i%80*400);
})();