Skip to content

Instantly share code, notes, and snippets.

View fen89's full-sized avatar

Tobi fen89

View GitHub Profile
@marlun78
marlun78 / JavaScriptTimeConverter.cs
Last active January 28, 2023 03:57
C# to/from JavaScript date converter
/**
* C# <> JavaScript Date Converter
* Copyright (c) 2011 marlun78
* MIT License, https://gist.github.com/marlun78/bd0800cf5e8053ba9f83
*/
/// <summary>
/// Provides a Convert method to convert between C# DateTime values and JavaScript parsable Int64 date values.
/// </summary>
public static class JavaScriptDateConverter
{
@xeoncross
xeoncross / gitstats.sh
Created November 5, 2012 21:35
Git - calculate how many lines of code were added/changed by someone
# Run this in the project repo from the command-line
# http://stackoverflow.com/a/4593065/99923
git log --shortstat --author "Xeoncross" --since "2 weeks ago" --until "1 week ago" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}'
// Highcharts CheatSheet Part 1.
// Create interactive charts easily for your web projects.
// Download: http://www.highcharts.com/download
// More: http://api.highcharts.com/highcharts
// 1. Installation.
// Highcharts requires two files to run, highcharts.js and either jQuery, MooTools or Prototype or the Highcharts Standalone Framework which are used for some common JavaScript tasks.
// <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
// <script src="https://code.highcharts.com/highcharts.js"></script>
@belsrc
belsrc / gist:672b75d1f89a9a5c192c
Last active April 15, 2023 15:13
Simple Vue.js filters that I usually need
/**
* Changes value to past tense.
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc.
* http://jsfiddle.net/bryan_k/0xczme2r/
*
* @param {String} value The value string.
*/
Vue.filter('past-tense', function(value) {
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing
var vowels = ['a', 'e', 'i', 'o', 'u'];
@mbbx6spp
mbbx6spp / ALTERNATIVES.adoc
Last active January 7, 2025 16:25
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active April 11, 2025 08:16
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@ajaxray
ajaxray / select2-cascade.js
Last active April 21, 2025 14:09
Making Select2 (4.x) list boxes cascading / dependent. Options of a select2 list box will be loaded/refreshed by ajax based on selection of another select2 list box.
/**
* A Javascript module to loadeding/refreshing options of a select2 list box using ajax based on selection of another select2 list box.
*
* @url : https://gist.github.com/ajaxray/187e7c9a00666a7ffff52a8a69b8bf31
* @auther : Anis Uddin Ahmad <[email protected]>
*
* Live demo - https://codepen.io/ajaxray/full/oBPbQe/
* w: http://ajaxray.com | t: @ajaxray
*/
var Select2Cascade = ( function(window, $) {
@dpedro
dpedro / a2-forms-singleControl
Last active October 20, 2023 11:45
Single form control (without FormGroup)
<!--
Sometimes, we don’t need a FormGroup, as our form might only consist of a single form control. Think of a search field that let’s you search for products in an e-commerce application. Technically, we don’t even need a <form> element for that.
Angular comes with a directive formControl which doesn’t have to be inside a formGroup. We can simply add it to a single form control and are ready to go:
-->
<!-- no surrounding form -->
<input type="search" [formControl]="seachControl">
<!--
The cool thing about form controls in Angular is,
@fernandohu
fernandohu / Reading configuration files before application startup in Angular2 final release.md
Last active July 7, 2024 19:31
Reading configuration files before application startup in Angular2 final release

Reading data before application startup in Angular 2

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'.

@derekbtw
derekbtw / bootstrap-jumpstart-server.bat
Created February 15, 2017 12:15
Place this batch file in any directory and run it to: create a new project, start a browser-sync server, create and listen to a scss file
cd projects
@echo off
COLOR 0A
set /p dname= New project name:
git clone https://github.com/BlackrockDigital/startbootstrap-bare.git %dname%
cd %dname%
mkdir scss
cd scss
echo //main > main.scss