Skip to content

Instantly share code, notes, and snippets.

View hacknightly's full-sized avatar
:octocat:
On Github

Darrell Banks hacknightly

:octocat:
On Github
View GitHub Profile
@hacknightly
hacknightly / gist:3783894
Created September 25, 2012 19:23 — forked from JosephPecoraro/shell-execution.rb
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Returns the result of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@hacknightly
hacknightly / django.wsgi
Created June 7, 2012 18:45
An example django.wsgi file
import os, sys
sys.path.append('/home/staging/')
sys.path.append('/home/staging/app/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
@hacknightly
hacknightly / nginx.conf
Created June 7, 2012 17:44
Basic Nginx Conf
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
}
<div> My name is {{name}} </div>
<div>
<!-- '#' creates a local variable called newname -->
<input #newname type="text" />
<!-- newname can now be used locally -->
<button (click)="changeName(newname.value)"
[disabled]="newname.value === 'david'">
<!-- (click) is an event binding that can take any event registered in the DOM -->
<!-- [disabled] is an attribute binding -->
Change Name
import {bootstrap} from ‘angular’;
import {TodoApp} from ‘todoapp’;
bootstrap(todoApp);
// AtScript Component
@Component({
selector: 'todo-app',
template: new TemplateConfig({
url: '/todos.html'
})
});
// Component Controller
class TodoApp {