Skip to content

Instantly share code, notes, and snippets.

@mulderu
mulderu / php-cheat-sheet-01.md
Last active June 8, 2021 12:04
php cheat sheet , php look up code, php simple guide
# syntax
array ( "key" => "value", … );
die("message");
do { block } while (condition);
$x = 1; 
while($x <= 5) {
    echo "The number is: $x <br>";
    $x++;
}
// ref : https://medium.com/@parshwamehta13/basics-of-method-chaining-in-javascript-using-lodash-16f1168cf066
// <script src="https://cdn.jsdelivr.net/npm/lodash@4.17.15/lodash.min.js"></script>
var users = [
{
"user": "barney",
"age": 36
},
{
"user": "fred",
@mulderu
mulderu / dugan-trial.md
Created October 22, 2019 05:17
dugan config

DCGAN

128

Namespace(batchSize=1, beta1=0.5, cuda=True, dataroot='data', dataset='folder', imageSize=128, lr=0.0002, manualSeed=None, ndf=128, netD='', netG='', ngf=128, ngpu=1, niter=25, nz=2048, outf='output', workers=2) Generator(
  (main): Sequential(
    (0): ConvTranspose2d(2048, 1024, kernel_size=(4, 4), stride=(1, 1), bias=False)
    (1): BatchNorm2d(1024, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (2): ReLU(inplace)
@mulderu
mulderu / basic.array-js.md
Created September 10, 2019 05:43
javascript array basic 01

array operation : pop, push, shift, unshift, slice, splice

> a=[1,2,3,4,5,6,7]
[ 1, 2, 3, 4, 5, 6, 7 ]
> a.pop()
7
> a
[ 1, 2, 3, 4, 5, 6 ]
> a.shift()
1
@mulderu
mulderu / python-util.py
Created December 19, 2018 03:01
python utility sets
def loadLines(path, rmSharp=False):
""" line by line reader : output : array """
fp = open(path, "r")
alls = fp.read().split("\n")[:-1]
if (rmSharp):
lines = []
for line in alls:
line = line.strip()
if line.startswith('#'):
continue
@mulderu
mulderu / threejs-image-cube-list.html
Created July 15, 2019 02:55
example for three js texture in box
<!DOCTYPE html>
<html>
<head>
<title>learningthree.js boiler plate for three.js</title>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
/>
@mulderu
mulderu / pytorch.mnist.py
Created June 26, 2019 19:13
pytorch mnist
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
class Net(nn.Module):
@mulderu
mulderu / gulpfile.js
Created April 12, 2018 09:17
gulp mustache browsersync
var gulp = require('gulp');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var include = require('gulp-include');
var mustache = require('gulp-mustache');
var cleanCSS = require('gulp-clean-css');
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>