Skip to content

Instantly share code, notes, and snippets.

@juancarloscruzd
juancarloscruzd / gist:3484768
Created August 27, 2012 00:57 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
<?php
require("./amazon-sdk/sdk.class.php");
// on ubuntu - this script can be run using php5-cli and php5-curl
//Provide the Key and Secret keys from amazon here.
$AWS_KEY = "kkk";
$AWS_SECRET_KEY = "kkkk+xKcdkB";
//certificate_authority true means will read CA of amazon sdk and false means will read CA of OS
$CA = true;
@juancarloscruzd
juancarloscruzd / paty.cpp
Last active December 30, 2015 09:39
Patty, ahi ta tu trabajo....no lo he terminado de probar ...sobre todo la parte D3. Si lo vas a presentar impreso, como si nada....si lo vas a tener que correr en laboratorio ...ahi si está la incertidumbre...hasta el paso D2 lo he testeado y funciona perfecto. El paso D3 solo lo he traducido.
//
// main.cpp
// patty
//
// Created by Juanca on 2/12/13.
// Copyright (c) 2013 Juancarlos Cruz. All rights reserved.
//
#include <iostream>
#include <iomanip>

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/

IDs

  • user_id - user/:uid
  • feed_id - feed/:feed_uri
  • category_id - :user_id/category/:category (special category: global.all, global.uncategorized)
  • tag_id - :user_id/tag/:tag (special tag: global.saved)

APIs

http://cloud.feedly.com/:version/:api

@juancarloscruzd
juancarloscruzd / html5-template.html
Created July 10, 2014 22:03
HTML5 Template (commented)
<!DOCTYPE html>
<head>
<!-- Tell Internet Explorer to use the most current layout engine available
READ: https://www.modern.ie/en-us/performance/how-to-use-x-ua-compatible -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Declare a character set for web performance
Do it through the HTTP header as the first option
Make sure HTTP header and meta tag are the same
READ: https://developers.google.com/speed/docs/best-practices/rendering#SpecifyCharsetEarly -->
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://necolas.github.io/normalize.css/3.0.1/normalize.css" type="text/css" media="screen">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js" /></script>
<script type="text/javascript" src="https://mandrillapp.com/api/docs/js/mandrill.js"></script>
<style>
.main-wrapper{
height: 800px;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
public class Main extends JFrame {
public Main() {
setSize(300, 300);
setTitle("Window Listener");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);