Skip to content

Instantly share code, notes, and snippets.

View sombochea's full-sized avatar

Sambo Chea sombochea

View GitHub Profile
@sombochea
sombochea / mean.json
Last active February 24, 2020 14:10
First People Json Data
{
"people": [
{
"name": "Mean Sous"
},
{
"name": "Sombo Chea"
}
]
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
public class User {
public string FirstName { get; set; }
public string LastName { get; set; }
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
public class User {
public string FirstName { get; set; }
public string LastName { get; set; }
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
public class User {
public string FirstName { get; set; }
public string LastName { get; set; }
}
@sombochea
sombochea / Setting.php
Last active April 25, 2019 06:52
Sample Setting Model in Laravel Eloquent with Except function
<?php
namespace App;
class Setting extends BaseModel
{
protected $fillable = ['key', 'value'];
// Need to remove this variables before save to db.
protected $excepts = ['type'];

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.

Keybase proof

I hereby claim:

  • I am sombochea on github.
  • I am sombochea (https://keybase.io/sombochea) on keybase.
  • I have a public key ASBWyCxmAfN6WqjdF4D_9zxZQW9YQjeR1XFMYJpmx_LU1go

To claim this, I am signing this object:

@sombochea
sombochea / vcl-regex-cheat-sheet
Created January 30, 2020 16:36 — forked from dimsemenov/vcl-regex-cheat-sheet
Regular expression cheat sheet for Varnish (.vcl). Examples of vcl regexp. Found here http://kly.no/varnish/regex.txt (by Kristian Lyngstøl)
Regular expression cheat sheet for Varnish
Varnish regular expressions are NOT case sensitive. Varnish uses POSIX
regular expressions, for a complete guide, see: "man 7 regex"
Basic matching:
req.url ~ "searchterm"
True if req.url contains "searchterm" anywhere.
req.url == "searchterm"
@sombochea
sombochea / FactoryTests.kt
Last active October 13, 2020 05:39
Simple Factory Pattern on Kotlin
package com.cubetiqs.factory
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class FactoryTests {
@Test
fun factoryTest() {
val carA = CarFactory(CarType.CAR_A).getCar()
@sombochea
sombochea / export.print.json
Last active October 14, 2020 02:28
Stock Import and Export for Print output (Internal only for CUBETIQ Software)
{
"configs": {
"title": "CUBETIQ Coperation Co,Ltd",
"headline": "Export Items",
"logoUrl": "https://visme.co/blog/wp-content/uploads/2017/08/40-Creative-Logo-Designs-to-Inspire-You-Movers-logo.jpg"
},
"data": {
"invoiceNumber": "INV00001",
"date": "13-10-2020",
"time": "10:30 AM",