Skip to content

Instantly share code, notes, and snippets.

🏸
Focusing

Carsten Jonstrup cjonstrup

🏸
Focusing
Block or report user

Report or block cjonstrup

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
@cjonstrup
cjonstrup / User.php
Created Mar 17, 2019
Slack - Laravel
View User.php
class User extends Authenticatable implements MustVerifyEmail
{
use Notifiable;
const SLACK_CHANNEL_WWW = 'xxx';
const SLACK_CHANNEL_BACKEND = 'xxx';
protected $slackChannels= [
self::SLACK_CHANNEL_WWW,
self::SLACK_CHANNEL_BACKEND,
View .gitconfig
[user]
name = xxx
email = xxx@xxx.dk
[core]
whitespace = trailing-space,space-before-tab
editor = vim
[diff]
renames = copy
[color]
diff = auto
@cjonstrup
cjonstrup / import.cs
Last active Mar 13, 2019
C# Postgresql - Fast import
View import.cs
using (var connection = HeroukoPostgresql)
{
var watch = System.Diagnostics.Stopwatch.StartNew();
connection.Open();
var trans = connection.BeginTransaction();
try
{
ExecuteNonQuery("TRUNCATE xxx", connection);
View NaturalSort.cs
public class NaturalSortComparer : IComparer<string>, IDisposable
{
private bool isAscending;
public NaturalSortComparer(bool inAscendingOrder = true)
{
this.isAscending = inAscendingOrder;
}
public int Compare(string x, string y)
View app\Http\Kernel.php
<?php
// ...
protected $middleware = [
// ...
'App\Http\Middleware\ValidProxies',
];
// ...
View .bash_profile
export PS1="________________________________________________________________________________\n| \w @ \h (\u) \n| => "
export PS2="| => "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
zipf () { zip -r "$1".zip "$1" ; }
# extract: Extract most know archives with one command
# ---------------------------------------------------------
@cjonstrup
cjonstrup / Laravel\app\commands\ViewsCommand.php
Last active Aug 1, 2019
Clear Laravel 4.* app/storage/views artisan views:clear
View Laravel\app\commands\ViewsCommand.php
<?php
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
class ViewsCommand extends Command {
/**
* The console command name.
*
* @var string
You can’t perform that action at this time.