Skip to content

Instantly share code, notes, and snippets.

View up1's full-sized avatar

Somkiat Puisungnoen up1

View GitHub Profile
@up1
up1 / composer.json
Last active May 14, 2016 09:17
Satis :: Local composer repository
{
"repositories": [
{
"type": "composer",
"url": "http://localhost:4680/"
}
],
"config": {
"secure-http": false
},
@up1
up1 / logic-spec.js
Last active May 20, 2016 05:53
e2e test of wordpress
test.before( 'Start Browser', function() {
this.timeout( startBrowserTimeoutMS );
driver = driverManager.startBrowser();
} );
test.describe( 'Authentication: (' + screenSize + ')', function() {
this.timeout( mochaTimeOut );
this.bailSuite( true );
test.describe( 'Logging In and Out:', function() {
@up1
up1 / list-container.txt
Created May 21, 2016 04:13
Jenkins on Docker
$docker pa -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e614797e3af7 jenkins2 "/bin/tini -- /usr/lo" 22 minutes ago Up 22 minutes 0.0.0.0:8080->8080/tcp, 0.0.0.0:50000->50000/tcp jenkins-master
9fae0c4f4d66 jenkins-data "echo 'Data container" About an hour ago Exited (0) About an hour ago jenkins-data
@up1
up1 / ModelFactory.php
Last active August 18, 2018 01:14
TDD with Laravel
$factory->define(App\User::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'email' => $faker->safeEmail,
'password' => bcrypt(str_random(10)),
'remember_token' => str_random(10),
];
});
@up1
up1 / build.gradle
Created June 3, 2016 00:15
Size of APK
apply plugin: 'com.android.application'
android {
....
}
buildscript {
repositories {
jcenter()
}
@up1
up1 / 1.java
Last active June 7, 2016 15:39
Android Coding Style
void setServerPort(String value) {
try {
serverPort = Integer.parseInt(value);
} catch (NumberFormatException e) { }
}
@up1
up1 / NotesActivityTest.java
Created June 11, 2016 15:10
Espresso Test Record
LargeTest
@RunWith(AndroidJUnit4.class)
public class NotesActivityTest {
@Rule
public ActivityTestRule<NotesActivity> mActivityTestRule = new ActivityTestRule<>(NotesActivity.class);
@Test
public void notesActivityTest() {
ViewInteraction floatingActionButton = onView(
@up1
up1 / 01.txt
Created July 1, 2016 16:37
Fun comment
/*
The CEO of the company (and my former boss) sold the company
leaving me free to comment the code as I should have. The
former CEO of the company will be referred to as Dip Shit, or DS for short.
DS thinks he is a software developing genius. Unfortunately for
me (the maintenance programmer) I spent too much time cleaning
up Dip's Shit.
DS is a daredevil developer. Like Evel Knievel his code uses
the GOTO statement frequently jumping daringly from a code
@up1
up1 / Package.swift
Last active July 3, 2016 07:43
Swift for Web
import PackageDescription
let package = Package(
name: "HelloWorld",
dependencies: [
.Package(url: "https://github.com/qutheory/vapor.git", majorVersion: 0, minor: 10)
]
)
@up1
up1 / MainViewController.swift
Last active July 7, 2016 13:02
Swift :: Composition over Inheritance
class MainViewController: UIViewController, NetworkDelegator {
let myNetwork = MyNetwork()
override func viewDidLoad() {
super.viewDidLoad()
myNetwork.delegate = self
}