Skip to content

Instantly share code, notes, and snippets.

View d30jeff's full-sized avatar
💭
Eating caviar and hacking famine

Deojeff d30jeff

💭
Eating caviar and hacking famine
View GitHub Profile
@d30jeff
d30jeff / error
Created September 28, 2016 07:09
Libwebsocket - LWSWS error log
lwsws[9182]: lwsws libwebsockets web server - license CC0 + LGPL2.1
lwsws[9182]: (C) Copyright 2010-2016 Andy Green <[email protected]>
lwsws[9182]: Using config dir: "/etc/lwsws"
lwsws[9182]: Initial logging level 7
lwsws[9182]: Libwebsockets version: 2.0.0 [email protected]
lwsws[9182]: IPV6 not compiled in
lwsws[9182]: libev support not compiled in
lwsws[9182]: libuv support compiled in and enabled
lwsws[9182]: Threads: 1 each 1024 fds
lwsws[9182]: mem: platform fd map: 8192 bytes
@d30jeff
d30jeff / main.js
Created August 9, 2016 04:09
What is this front end bullshit?
// Just to make life easier.
var common = {
ajaxPut: function(url, body) {
return $.ajax({
url: url,
type: 'PUT',
dataType: 'json',
data: body
});
},
@d30jeff
d30jeff / index.php
Created April 29, 2016 06:34
Get highest number in a multidimensional array.
<?php
$arr = [
0 => [
10000,
9000,
2000,
3000,
]
];
@d30jeff
d30jeff / settings.json
Last active April 20, 2016 07:59
Rahsia dunia
{
"caret_extra_width": 3,
"caret_style": "phase",
"centurion_folder_icons": true,
"color_scheme": "Packages/Theme - Cyanide/Monocyanide - Contrasted Light.tmTheme",
"contrasted_sidebar": true,
"contrasted_tabs": true,
"ensure_newline_at_eof_on_save": true,
"findreplace_small": true,
"font_size": 13,
@d30jeff
d30jeff / index.php
Created March 7, 2016 07:13
Anyone can help me in array ?
<?php
$arr = ['A','A','B','C','F','F'];
$uniqueChars = array_diff_assoc($arr, array_unique($arr));
print_r($uniqueChars); // First Question
print_r(current($uniqueChars)); // Second Question
@d30jeff
d30jeff / settings.json
Created March 7, 2016 03:17
Sublime Text settings
{
"caret_extra_width": 2,
"caret_style": "phase",
"centurion_folder_icons": true,
"color_scheme": "Packages/Theme - Cyanide/Monocyanide - Contrasted Light.tmTheme",
"contrasted_sidebar": true,
"contrasted_tabs": true,
"ensure_newline_at_eof_on_save": true,
"findreplace_small": true,
"font_size": 11,
@d30jeff
d30jeff / index.php
Created February 22, 2016 09:47
IT 24 Hours
<?php
function dd($arg) {
die(var_dump($arg));
}
$getOddAndEven = function($number) {
if (is_numeric($number)) {
$odd = ceil($number / 2);
return [
@d30jeff
d30jeff / index.php
Created February 17, 2016 03:14
Ok tak soalan nie sebagai internship interview question? In a string containing many words, find the longest word.
<?php
$arr = ['a', 'bc', 'def', 'longest'];
usort($arr, function($a, $b) {
return strlen($b) - strlen($a);
});
echo $arr[0];
@d30jeff
d30jeff / example.txt
Created February 12, 2016 13:34
Pseudocode for Alphalab
Hi,
Due to hardware limitation I'm afraid I have to write a pseudocote for this task.
If neccessary, I am willing to go there to code it in front of you guys, with your computers.
Here's my way of solving this particular problem.
Note that this current solution doesn't escape or sanitize user input, SQL injection is very possible at this point.
Database Design:
Database name: test-database
@d30jeff
d30jeff / example.txt
Created February 12, 2016 13:34
Pseudocode for Alphalab
Hi,
Due to hardware limitation I'm afraid I have to write a pseudocote for this task.
If neccessary, I am willing to go there to code it in front of you guys, with your computers.
Here's my way of solving this particular problem.
Note that this current solution doesn't escape or sanitize user input, SQL injection is very possible at this point.
Database Design:
Database name: test-database