Skip to content

Instantly share code, notes, and snippets.

View tucq88's full-sized avatar
🎯
Fake it till you make it. Confidence is more important than knowledge.

Tu Chu tucq88

🎯
Fake it till you make it. Confidence is more important than knowledge.
View GitHub Profile
<!-- Hero CTA -->
<button class="c-button c-button--outline t-red c-hero__button js-hero-button qa-hero-button">Hero CTA</button>
// Button base
.c-button {} 

// Button modifier with structural properties.
// In example: `border: 1px solid transparent; padding: 5px 10px;`
@aemonge
aemonge / prepare-commit-msg
Last active March 1, 2024 01:02
Angular Commit Message Conventions git hook, so you got your commit prepared to with the messages they expect ;)
#!/bin/bash
firstLine=`head -2 $1 | tail -1`
if [[ $firstLine == \#* ]]; then # Testing that the file starts with a comment, not yet a real commit ;)
echo '<type>(<component>): <subject>' > .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '<body>' >> .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '# types: feat, fix, docs, style, refactor, test, chore(mantean)' >> .prepare-commit-msg-temp
@mrhieu
mrhieu / rest.js
Last active March 27, 2017 14:54
AngularJS: factory that adds restful support to any factory
'use strict';
/**
* @ngdoc service
* @name app.services.service:RestService
*
* @description
* The common service to quickly setup other services to expose a restful-like interface
*
* How to use in a factory
@nozzlegear
nozzlegear / email-widget.js
Last active July 14, 2020 02:07
This is an example email capturing widget, used to demonstrate the power of Shopify's script tags to add dynamic functionality to a Shopify store front. Learn more about using Shopify script tags with The Shopify Development Handbook at https://nozzlegear.com/shopify-development-handbook.
(function ()
{
//Build a pseudo-class to prevent polluting our own scope.
var api = {
Settings: {},
Vox: {},
Start: function ()
{
//Get the *.myshopify.com domain
var shop = Shopify.shop;
@gilbitron
gilbitron / .env.travis
Last active August 12, 2023 08:06
Laravel 5 Travis CI config
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@ericlbarnes
ericlbarnes / app.js
Created July 22, 2015 02:18
Example delete request
$(document).ready(function() {
$("button.remove").on('click', function(e){
e.preventDefault();
if ( ! confirm('Are you sure?')) {
return false;
}
var action = $(this).data("action");
var parent = $(this).parent();
$.ajax({
type: 'delete',
@famanson
famanson / ember-stuff.md
Last active August 29, 2015 14:25
EmberJS resources (Hanoi Javascript meetup)

EmberJS resources:

  • Main EmberJS website
  • ember-cli - command-line tools for project setup and deployment
  • ember-cli-deploy - lightning-fast deployment of Ember to redis/S3 included in eember-cli. You can find an example of a Redis-backed Flask-based Ember frontend endpoint I wrote here. An example deploy.js file that Esplorio uses can be found here
  • For those interested in Google Map integration, you can check this out (only compatible with Ember 1.13 for now - we skipped the latest version since 2.0 is coming up real soon)
  • For those interested in Ember server-side rendering, you can check out fastboot
  • A list of websites built with Ember can be found here
  • Esplorio
@xjamundx
xjamundx / blog-webpack-2.md
Last active April 21, 2024 16:20
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@joecampo
joecampo / Connecting PHP 5.6 to MSSQL.md
Last active June 4, 2022 14:20
Connecting PHP 5.6 to MSSQL - Ubuntu (Debian) w/ Apache