Skip to content

Instantly share code, notes, and snippets.

View taai's full-sized avatar

Jānis Lācis taai

  • Latvia
View GitHub Profile
@sumonst21
sumonst21 / index.html
Created August 30, 2021 00:20
Select Field with Search - AlpineJs + Tailwind
<div class="flex flex-col items-center">
<div class="w-full md:w-1/2 flex flex-col items-center h-64">
<div class="w-full px-4">
<div x-data="selectConfigs()" x-init="fetchOptions()" class="flex flex-col items-center relative">
<div class="w-full">
<div @click.away="close()" class="my-2 p-1 bg-white flex border border-gray-200 rounded">
<input
x-model="filter"
x-transition:leave="transition ease-in duration-100"
x-transition:leave-start="opacity-100"
@eldh
eldh / LazyRender.coffee
Last active August 29, 2015 14:23
Lazy render react component
module.exports = React.createClass
displayName: 'LazyRender'
getInitialState: -> props: @props
componentWillReceiveProps: (newProps) -> setTimeout (=> @setState newProps), 10
shouldComponentUpdate: (newProps, newState) -> @state isnt newState
@addyosmani
addyosmani / LICENSE.txt
Last active April 8, 2024 20:15 — forked from 140bytes/LICENSE.txt
Offline Text Editor in < 140 bytes (115 bytes). Powered by localStorage & contentEditable
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Copyright (C) 2014 ADDY OSMANI <addyosmani.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@dnch
dnch / bad_idea.js
Created February 12, 2014 02:55
Animaniacs presents: Good Idea / Bad Idea, the Bower and Gulp edition.
// BAD IDEA: Not enforcing any sorts of rules about how packages are composed.
//
// Bower allows developers to override certain properties of each package's bower
// definition. Which is handy when packages are badly composed.
//
// In everyone's defence, Bower is still relatively new and given that there's a
// seemingly infinite number of ways to get to the end-point, there really is no
// right or wrong way to do it.
//
"overrides": {
@dariodiaz
dariodiaz / gulpfile.js
Created January 30, 2014 03:33 — forked from laracasts/gulpfile.js
laravel: gulp config for laravel
var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var autoprefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css')
var coffee = require('gulp-coffee');
var exec = require('child_process').exec;
var sys = require('sys');
@BradEstey
BradEstey / gulpfile.js
Last active December 21, 2018 05:49
Use Gulp to automatically run PHPUnit tests.
var gulp = require('gulp'),
sys = require('sys'),
exec = require('child_process').exec;
gulp.task('phpunit', function() {
exec('phpunit', function(error, stdout) {
sys.puts(stdout);
});
});
/*
This is an EXAMPLE gulpfile.js
You'll want to change it to match your project.
Find plugins at https://npmjs.org/browse/keyword/gulpplugin
*/
var gulp = require('gulp');
var uglify = require('gulp-uglify');
gulp.task('scripts', function() {
// Minify and copy all JavaScript (except vendor scripts)
@anissen
anissen / .jscs.json
Last active January 25, 2024 23:58
Example gulpfile for some useful tasks
{
"requireCurlyBraces": ["else", "for", "while", "do", "try", "catch"],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowRightStickedOperators": ["?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"requireRightStickedOperators": ["!"],
"requireLeftStickedOperators": [","],
"disallowImplicitTypeConversion": ["string"],
"disallowKeywords": ["with"],
"disallowMultipleLineBreaks": true,
@laracasts
laracasts / test.php
Last active July 10, 2018 16:33
Transactions for functional/integration tests.
<?php
class ExampleTest extends TestCase {
public function setUp()
{
parent::setUp();
DB::beginTransaction();
}
@bennadel
bennadel / multiple-dropzones.htm
Created December 15, 2013 01:44
Using Multiple Dropzones And File Inputs With A Single Plupload Instance
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>
Using Multiple Dropzones With A Single Plupload Instance
</title>
<link rel="stylesheet" type="text/css" href="./assets/css/styles.css"></link>