Skip to content

Instantly share code, notes, and snippets.

View dexterbrylle's full-sized avatar

Dexter Brylle dexterbrylle

View GitHub Profile
@dexterbrylle
dexterbrylle / integerlist.js
Last active December 21, 2015 05:10
Given a list of all the numbers from 1 to 100 not in any particular order, and the user always deletes the 2nd number from that list. Write an algo to identify the number that the user deleted.
for (var i = 0; i < arrIntegerList.length; i++) {
if (i === 1) {
console.log('User deleted -> ' + arrIntegerList[i]);
} else {
console.log(i);
}
}
@dexterbrylle
dexterbrylle / wallpapers.sh
Last active March 14, 2016 03:40
Get top random wallpapers from reddit
curl -s 'http://www.reddit.com/r/wallpapers' \
| tr '"' '\n' | grep imgur | tee "$$.tmp" \
| egrep '^http://i\.imgur\.com/' \
| xargs wget -q -nc
egrep '^http://imgur.com/a/' "$$.tmp" \
| xargs -l1 imgur_album_download.sh
rm "$$.tmp"
@dexterbrylle
dexterbrylle / nginx + node+angular
Created May 2, 2016 17:27
Nginx config for MEAN stack
upstream someserver {
server 127.0.0.1:5000;
keepalive 16;
}
server {
listen 80;
server_names someserver.com www.someserver.com;
access_log /var/log/nginx/someserver.log;
@dexterbrylle
dexterbrylle / .gitignore
Created May 16, 2016 15:04
Gitignore for projects
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
@dexterbrylle
dexterbrylle / Preferences.sublime-settings
Last active July 31, 2017 05:18
Sublime Text 3 Settings
{
"always_show_minimap_viewport": true,
"animation_enabled": true,
"auto_close_tags": true,
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_indent": true,
"auto_match_enabled": true,
"bold_folder_labels": true,
"caret_style": "smooth",
@dexterbrylle
dexterbrylle / .jscsrc
Created September 26, 2016 10:24
.jscsrc from AirBnB style guide
{
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideBrackets": true,
"disallowEmptyBlocks": true,
"disallowSpacesInCallExpression": true,
@dexterbrylle
dexterbrylle / .jshintrc
Created September 26, 2016 10:25
.jshintrc
{
/*
* ENVIRONMENTS
* =================
*/
// Define globals exposed by modern browsers.
"browser": true,
// Define globals exposed by jQuery.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="initial-scale=1.0">
<!-- So that mobile webkit will display zoomed in -->
<meta name="format-detection" content="telephone=no">
<!-- disable auto telephone linking in iOS -->
<title>Merry Christmas from Wunderman Manila</title>
@dexterbrylle
dexterbrylle / install-git-kraken.sh
Last active July 31, 2017 05:21
Install Git Kraken on Ubuntu
wget https://release.gitkraken.com/linux/gitkraken-amd64.deb | sudo dpkg -i gitkraken-amd64.deb
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = tab
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true