Skip to content

Instantly share code, notes, and snippets.

View thejsj's full-sized avatar

Jorge Silva thejsj

View GitHub Profile
@thejsj
thejsj / SublimeTextPreferences.json
Created January 17, 2014 16:27
My sublime text settings... just in case I need then again
{
"auto_indent": true,
"create_window_at_startup": false,
"detect_indentation": true,
"font_size": 12.0,
"ignored_packages":
[
"Vintage",
"Markdown"
],
@thejsj
thejsj / MagentoGitIgnore.txt
Last active January 4, 2016 03:39
A gitignore for magento. Only time will tell how good this actually is.
# Ignore File Types
.project
*.sublime-project
*.sublime-workspace
*.tmproj
*.bak
*.swp
*~.nib
# Ignore Default files, Licenses, Readmes, etc.
#!/bin/sh
#
# A simple commit shell script
# Instructions:
# source ./commit.sh LOCAL_BRANCH_NAME 'COMMIT_MESSAGE'
#
# Example:
# source ./commit.sh staging 'Adding some cool files to this repo'
#
@thejsj
thejsj / adelle-todo.md
Last active August 29, 2015 13:57
Adelle Todo

Bugs

  • Index page
  • Name on node hover

Deployment

  • Register Domain ( which domain? )
  • Create server ( where will this be hosted? )
  • Install Wordpress on server
@thejsj
thejsj / parseJSON.js
Last active August 15, 2018 16:10
A custom parseJSON funciton
const parseJSON = function (json) {
// Higher-order function to be used for detecting type
const firstAndLastChars = function (first, last) {
return (str) => str[0] === first && str[str.length - 1] === last
}
const isArray = firstAndLastChars('[', ']')
const isObj = firstAndLastChars('{', '}')
const hasDoubleQuotes = firstAndLastChars('"', '"')
const hasSingleQuotes = firstAndLastChars("'", "'")
const isNumber = (str) => (+(str)) + '' === str
@thejsj
thejsj / sublime-text-use-settings
Created November 1, 2014 17:11
Sublime Text User Settings
{
"auto_complete": true,
"bold_folder_labels": true,
"caret_style": "blink",
"close_windows_when_empty": true,
"draw_indent_guides": true,
"ensure_newline_at_eof_on_save": true,
"font_face": "menlo",
"font_size": 17.0,
"highlight_line": true,
@thejsj
thejsj / reql.js
Last active August 29, 2015 14:17
ReQL on a JSON
r.http('http://api.reddit.com/subreddits/popular.json')('data')('children')
.map(r.row('data')('title'))
r.expr({name: "jorge"})('name')
r.expr(JSON.parse('{"name": "jorge"}'))('name')
@thejsj
thejsj / sending-image.js
Last active July 22, 2019 00:52
Realtime Image Whiteboard
/**
* Client Side
*
* Query an element and listen to files being drarg and dropped in order to
* send the file to the server throuth a POST and a PUT request
*/
// You must have an element with the ID `dropzone`
var el = document.getElementById('dropzone');
@thejsj
thejsj / if.js
Last active August 29, 2015 14:19
var obj = {
if: function (condition, trueStatement, falseStatement) {
if (condition) return trueStatement;
return falseStatment;
},
in: function () {
console.log('This is an `in` method');
},
arguments: function () {
console.log('This is an `arguments` method');
@thejsj
thejsj / basic-reql-queries
Created May 19, 2015 23:03
Basic ReQL Queries
# Queries
## Setup
Create the database in the data explorer. If you're using a shared instance of RethinkDB, name space your database name with your GitHub handle. If you're running these queries locally, you don't need to name space your database name.
```
r.dbCreate('GITHUB_HANDLE_rethinkdb_workshop')
r.db('GITHUB_HANDLE_rethinkdb_workshop').tableCreate('reddit')
```