Skip to content

Instantly share code, notes, and snippets.

View hendrasan's full-sized avatar
🇮🇩
Nothing much

Hendra Susanto hendrasan

🇮🇩
Nothing much
View GitHub Profile
@Jonarod
Jonarod / RadioBox.vue
Created November 23, 2019 18:23
Simple custom Radio component for Vue.js, compatible with v-model.
/**
* @usage:
*
* <RadioBox label="Foo" value="foo" v-model="MySelectedValue" />
* <RadioBox label="Bar" value="bar" v-model="MySelectedValue" />
* <RadioBox label="Baz" value="baz" v-model="MySelectedValue" />
*
* data(){
* return {
* MySelectedValue: "",
@rap2hpoutre
rap2hpoutre / gup-to-webpack.md
Last active November 22, 2023 00:30
Laravel 5.4: migrate from gulp to webpack
  • Create a webpack.mix.js file in root directory:
const { mix } = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css');
  
/* Optional: uncomment for bootstrap fonts */
// mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap');
@paulirish
paulirish / bling.js
Last active April 20, 2024 17:39
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 22, 2024 10:15
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@demisx
demisx / gulpfile.js
Last active July 14, 2022 16:06
Gulp 4 gulpfile.js
// Gulp 4
var gulp = require('gulp');
var using = require('gulp-using');
var grep = require('gulp-grep');
var changed = require('gulp-changed');
var del = require('del');
var coffee = require('gulp-coffee');
var less = require('gulp-less');
var coffeelint = require('gulp-coffeelint');
var sourcemaps = require('gulp-sourcemaps');
@fta2012
fta2012 / DragTransform
Last active October 9, 2022 15:32
Slightly modified compiled coffeescript from this codepen: http://codepen.io/fta/pen/ifnqH. Paste into console on a page that has jQuery to load the two dependent libraries (jquery-ui and numericjs). Then call makeTransformable('#selector-name') to make that element WYSIWYG editable. Use inspector to get the CSS for the transforms.
var selector = 'img' // Replace this with the selector for the element you want to make transformable
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() {
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() {
(function() {
var $, applyTransform, getTransform, makeTransformable;
$ = jQuery;
@razwan
razwan / _baseline.scss
Created April 14, 2014 16:20
Aligning type to baseline the right way with SASS
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {
@decthomas
decthomas / Gruntfile.js
Last active December 15, 2015 22:59
Example Gruntfile.js for use with Jekyll
// This is the main application configuration file. It is a Grunt
// configuration file, which you can learn more about here:
// https://github.com/cowboy/grunt/blob/master/docs/configuring.md
/*jslint nomen: true*/
'use strict';
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
// The clean task ensures the entire XXX folder is removed
clean: {
@addyosmani
addyosmani / timeUntil.js
Created July 11, 2012 14:21
Time until
var timeUntil = {
inHours: function(d1, d2) {
return parseInt((d2.getTime()-d1.getTime())/(24*3600), 10);
},
inDays: function(d1, d2) {
return parseInt((d2.getTime()-d1.getTime())/(24*3600*1000), 10);
},