See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
{-# OPTIONS_GHC -fno-warn-orphans #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
-- | Print STG in GHC 8.4.3. | |
module Main where | |
import Control.Monad.IO.Class (liftIO) | |
import qualified CorePrep |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ | |
./hardware-configuration.nix | |
]; | |
environment.systemPackages = (with pkgs; [ | |
google-chrome |
#!/usr/bin/env bash | |
cat "$1" \ | |
| sed -r 's/^(\s*)#/\1\/\//' \ | |
| sed -r 's/!//g' \ | |
| sed -r 's/^input /export interface /g' \ | |
| sed -r 's/^enum /export enum /g' \ | |
| sed -r 's/^type /export interface /g' \ | |
| sed -r 's/^union /export type /g'\ | |
| sed -r 's/^schema /export interface schema /g' \ | |
| sed -r 's/^(\s+[a-zA-Z0-9_-]+\s*)\([^\)]+\)(\s*:\s*)/\1\2/g' \ |
abstract class AbstractInternal<T> { | |
public abstract method(arg: T): void; | |
} | |
type InternalCtor<T> = new (param: T) => AbstractInternal<T>; | |
function createClass<T>(data: T): InternalCtor<T> { | |
abstract class Internal<T> implements AbstractInternal<T> | |
{ | |
public constructor(arg: T) { |
In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.
This is how the demonstration will load data:
a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';
b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.
if (typeof(String.prototype.equals) === "undefined") { | |
String.prototype.equals = function(compare) { | |
return new RegExp('^' + this + '$', 'i').test(compare); | |
} | |
} | |
// example | |
"TESTE".quals("teste"); |
require! [jison, util] | |
Parser = jison.Parser | |
_ = (expr) -> | |
rx = // | |
^function\s*\(\)\s*\{\s* | |
( | |
[\s\S]* | |
); |
/* **************************************************************************** | |
This code will generate a task.json file from your Gruntfile.js and will | |
allow you to run grunt tasks from inside VSCode | |
**************************************************************************** | |
1) Put this file in the same directory of your gruntfile.js (NOTE: must be | |
the app root directory) run the following command line: | |
node gt.js |
(defn my-last [xs] | |
(if (= (count xs) 1) | |
(first xs) | |
(my-last (rest xs)))) |