Skip to content

Instantly share code, notes, and snippets.

View altamic's full-sized avatar

Michelangelo Altamore altamic

View GitHub Profile
@marcelaraujo
marcelaraujo / gist:9a9fe07c5a4bcaea8c06
Created October 1, 2015 03:22
MacOS disable services
System process daemons that are system-wide provided by mac os x are described by launchd preference files that can be showed with the command:
$ sudo ls -all /System/Library/LaunchDaemons/
Third party process daemons that are system-wide provided by the administrator are described by preference files that can be showed with the command:
$ sudo ls -all /Library/LaunchDaemons/
Launch Agents that are per-user provided by mac os x usually loaded when the user logs in. Those provided by the system can be found with:
$ sudo ls -all /System/Library/LaunchAgents/
Launch Agents that are per-user provided by the administrator and usually loaded when the user logs in. Those provided by the system can be found with:
@metaist
metaist / Standalone-Chrome-Apps.markdown
Created September 18, 2014 15:35
Building, installing, and running a Standalone Chrome App

Build, Install, and Run a Chrome App without Chrome

Until [app_shell] is created, here is a workaround for building, installing, and running a standalone [Chrome App] for Windows.

Step 1 - Pack Your Chrome App

  1. Use chrome://extensions to package your app. The approach we're outlining here doesn't work for unpacked apps.
  2. You should have a .crx file that is your packaged app.
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 3, 2024 12:32
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@chaitanyagupta
chaitanyagupta / _reader-macros.md
Last active April 29, 2024 09:09
Reader Macros in Common Lisp

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.

@landonf
landonf / strongtalk.md
Last active October 25, 2020 09:49
A brief list of Strongtalk papers

In considering where Objective-C could go, it's worthwhile to start by understanding the work that's already been done.

Below are a selection of papers from Gilad Bracha's 1990s work on Strongtalk, an extension of Smalltalk (from which Objective-C's design derives) with (among other things), stronger type-safety tooling.

What's interesting (to me, anyway), is that the work done on the Self/Strongtalk VM in the early 90s was actually bought by Sun and became the modern Java VM. When Google got started on their V8 JavaScript runtime, guess who shows up again — Lars Bak, who was the technical lead for both the Strongtalk and HotSpot Java VMs.

If we're going to be talking about how to apply "modern" (1990s!) ideas to Objective-C, we'd be wise to review the considerable work done in considering those sorts of problems in a Smalltalk-derived universe, and lifting whatever good ideas we can, and discarding

class MiniTest::Unit::TestCase
def assert_change(block)
before = block.call
yield
refute_equal before, block.call
end
def refute_change(block)
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
body = self
@currentActionMode = getActivity.startActionMode do
def onCreateActionMode(actionMode:ActionMode, menu:Menu):boolean
body.actionMode.setTitle(R.string.photo_selection_cab_title)
inflater = body.getActivity.getMenuInflater # MenuInflater
inflater.inflate(R.menu.photo_context_menu, menu)
true
end
def makeCallback(callback:ActionMod.Callback)
callback
end
def foo
fragment = self
makeCallback do
def onDestroyActionMode(actionMode)
fragment.setSelected(false)
fragment.clearCurrentActionMode
@maccman
maccman / juggernaut_channels.rb
Created June 26, 2012 04:56
Sinatra Server Side Event streaming with private channels.
# Usage: redis-cli publish message.achannel hello
require 'sinatra'
require 'redis'
conns = Hash.new {|h, k| h[k] = [] }
Thread.abort_on_exception = true
get '/' do