Skip to content

Instantly share code, notes, and snippets.

View damianesteban's full-sized avatar
🎯
Focusing

Damian Esteban damianesteban

🎯
Focusing
View GitHub Profile
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04

The time is always right to do what is right. ~Martin Luther King Jr.

Summary (all you need to know)

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@damianesteban
damianesteban / List.swift
Created August 21, 2016 02:04 — forked from kristopherjohnson/List.swift
Functional list type for Swift
import Foundation
/// Abstract functional list type
///
/// Concrete types are EmptyList<T> and Cons<T>
public class List<T>: SequenceType {
/// Return true if this is an empty list, false if not
public var isEmpty: Bool { return true }
@damianesteban
damianesteban / UIImage+Tinting.swift
Created February 9, 2016 22:11 — forked from iamjason/UIImage+Tinting.swift
Swift UIImage extension for tinting images
/**
Usage:
let originalImage = UIImage(named: "cat")
let tintedImage = originalImage.tintWithColor(UIColor(red: 0.9, green: 0.7, blue: 0.4, alpha: 1.0))
*/
extension UIImage {
func tintWithColor(color:UIColor)->UIImage {
//: [Previous](@previous)
import UIKit
import Behavior
import XCPlayground
//: ## Task: Create a small counter application
//: This approach uses ports and behaviors
struct Counter {
#sudo apt-get install python-tornado
#there is an altertive as python3-tornado
#file below code into hello.py
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
# Python Help
python -h
# Calendar
python -m calendar
python -m calendar -h
python -m calendar 1999
# Zip and Gzip Tools
python -m zipfile -l pcblib.zip
@damianesteban
damianesteban / pySecureServer.py
Created August 15, 2013 22:30 — forked from ajself/pySecureServer.py
Secure python SimpleHTTPServer
# http://www.piware.de/2011/01/creating-an-https-server-in-python/
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
import BaseHTTPServer, SimpleHTTPServer
import ssl
httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='path/to/localhost.pem', server_side=True)
httpd.serve_forever()