Skip to content

Instantly share code, notes, and snippets.

Huy Tran htr3n

Block or report user

Report or block htr3n

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@laggardkernel
laggardkernel / startup-time-of-zsh.md
Last active Dec 5, 2019
Comparison of ZSH frameworks and plugin managers
View startup-time-of-zsh.md

Comparison of ZSH frameworks and plugin managers

Changelog

  • update 1: add a FAQ section
  • update 2: benchmark chart and feature comparison table
  • update 3:
    • improve the table with missing features for antigen
    • new zplg times result

TLDR

@skyzyx
skyzyx / single.html
Last active Oct 29, 2019
Hugo Partial for Generating the Table of Contents
View single.html
...
{{- partial "toc.html" . -}}
...
@15cm
15cm / compinit-oh-my-zsh.zsh
Last active Sep 18, 2019 — forked from ctechols/compinit.zsh
Speed up zsh compinit by only checking cache once a day.
View compinit-oh-my-zsh.zsh
# compinit optimization for oh-my-zsh
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
@meigwilym
meigwilym / console.php
Last active Oct 23, 2019
Laravel Create User Command
View console.php
<?php
// routes/console.php
// quickly create an user via the command line
Artisan::command('user:create', function () {
$name = $this->ask('Name?');
$email = $this->ask('Email?');
$pwd = $this->ask('Password?');
// $pwd = $this->secret('Password?'); // or use secret() to hide the password being inputted
\DB::table('users')->insert([
@lavaldi
lavaldi / tweaks-sublime-italic-operator-mono.md
Created Mar 16, 2017
Operator Mono & Sublime Text 3 themes
View tweaks-sublime-italic-operator-mono.md
  1. Install Package Resource Viewer.
  2. In package control window select ‘Package Resource Viewer: Open Resource’.
  3. Scroll down until you find the option: ‘Color Scheme — Default’ (or your theme with color scheme .tmTheme) and select it.
  4. Add the following
<!-- Operator Tweaks -->
  <dict>
    <key>name</key>
		<string>Italic HTML attribute names</string>
View css-breakpoint-mixins.scss
@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-landscape-up {
@media (min-width: 900px) { @content; }
}
@mixin for-desktop-up {
@blowsie
blowsie / glyphicon_font-awesome_convert.scss
Last active Oct 18, 2019
Map glyphicon icons to font-awesome
View glyphicon_font-awesome_convert.scss
$fa-font-path: "~font-awesome/fonts";
@import '~font-awesome/scss/font-awesome';
.glyphicon {
@extend .fa;
&.glyphicon-asterisk {
@extend .fa-asterisk;
}
&.glyphicon-plus {
@extend .fa-plus;
View Efficient font stack with Sass.md

Efficient font stack with Sass

The strength of Sass is the mixins and functions. Being able to automate many of the repetitive coding for CSS is both amazing in building and maintaining a clean and efficient code. I often find many developers creating complex systems for simple tasks, such as managing a font stack. This can be tedious to set up and employ. In this article, I will explain how I automate this system.

The font stack is one of those problems which are often solved by simple variables. In this instance, it makes a lot of sense and is easy enough to work with. But when you work with our (beloved) designers from Dogstudio, you can be sure of having to use lot of font variants. It quickly happens that I do not remember all the properties of each variants. And when I say "use lot of font variants", I mean at least 15 in most cases.

Sass maps to the rescue

Instead of simply define variables, I will ceate a font stack map and a mixin to use the map easily.

@ctechols
ctechols / compinit.zsh
Last active Nov 21, 2019
Speed up zsh compinit by only checking cache once a day.
View compinit.zsh
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
View browserify_for_webpack_users.markdown

browserify for webpack users

There's been a strange explosion in misinformation about browserify recently, particularly in comparisons to webpack.

Generally speaking, most of this confusion stems from how webpack is more willing to pull features into its core to ease discoverability while browserify is more likely to push features out to userland instead.

I think that longer-term, separability has more benefits from a maintenance and

You can’t perform that action at this time.