This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Directive, Input, HostListener, OnChanges, SimpleChanges, Renderer2, ElementRef } from '@angular/core'; | |
| @Directive({ | |
| selector: 'input[value]:not([ngModel])', | |
| }) | |
| export class MaintainInputCursorDirective implements OnChanges { | |
| @Input() value: string; | |
| renderedValue = ''; | |
| constructor(private renderer: Renderer2, private element: ElementRef) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Config do | |
| @moduledoc """ | |
| This module handles fetching values from the config with some additional niceties | |
| """ | |
| @doc """ | |
| Fetches a value from the config, or from the environment if {:system, "VAR"} | |
| is provided. | |
| An optional default value can be provided if desired. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // USAGE | |
| import React, { Component } from 'react' | |
| import { connect } from 'react-redux' | |
| import mapPropsChangeToCallbacks from './mapPropsChangeToCallbacks' | |
| // Specify props transition that should trigger specific callback | |
| const mappings = [ | |
| { method: 'onUploadStart', rule: (prev, next) => !prev.isUploading && next.isUploading }, | |
| { method: 'onUploadEnd', rule: (prev, next) => prev.isUploading && !next.isUploading }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############################################################################### | |
| ## # | |
| ## GIT IGNORE FOR WORDPRESS SITES # | |
| ## ------------------------------ # | |
| ## By: BigWilliam <hello@bigwilliam.com> # | |
| ## License: MIT - aka you can use/modify this how you want :) # | |
| ## # | |
| ############################################################################### | |
| ############################################################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Eclipse | |
| .project | |
| .classpath | |
| .settings | |
| .checkstyle | |
| # IntelliJ IDEA | |
| .idea | |
| *.iml | |
| *.ipr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (top.location != self.location) { | |
| top.location = self.location.href; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -webkit-touch-callout:none; | |
| -webkit-user-select:none; | |
| -khtml-user-select:none; | |
| -moz-user-select:none; | |
| -ms-user-select:none; | |
| user-select:none; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Smartphones (portrait and landscape) ----------- */ | |
| @media only screen | |
| and (min-device-width : 320px) | |
| and (max-device-width : 480px) { | |
| /* STYLES GO HERE */ | |
| } | |
| /* Smartphones (landscape) ----------- */ | |
| @media only screen | |
| and (min-width : 321px) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getAverageRGB(imgEl) { | |
| var blockSize = 5, // only visit every 5 pixels | |
| defaultRGB = {r:0,g:0,b:0}, // for non-supporting envs | |
| canvas = document.createElement('canvas'), | |
| context = canvas.getContext && canvas.getContext('2d'), | |
| data, width, height, | |
| i = -4, | |
| length, | |
| rgb = {r:0,g:0,b:0}, |
NewerOlder