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
// AtScript Component
@Component({
selector: 'todo-app',
template: new TemplateConfig({
url: '/todos.html'
})
});
// Component Controller
class TodoApp {
import {bootstrap} from ‘angular’;
import {TodoApp} from ‘todoapp’;
bootstrap(todoApp);
<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
@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;
}
@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 / 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 / app.js
Last active November 16, 2015 18:41 — forked from superherointj/app.js
// Hello. I'm learning. Thank you for sharing your insights.
var sUtil = require('sUtils.js');
var obj = {
a:[1,2],
b:[3,4],
}
Object.keys(obj).forEach(function(key) {
if (Array.isArray(obj[key])) {
@hacknightly
hacknightly / gist:4698714
Created February 2, 2013 18:27
Audio only ffmpeg
#!/bin/sh
./configure \
--prefix=$PREFIX \
--enable-cross-compile \
--arch=$ARCH \
--target-os=darwin \
--cc="/usr/bin/gcc-4.0" \
--extra-ldflags="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch $ARCH" \
--extra-cflags="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch $ARCH" \
script(id='pageTpl', type='text/html')
| <div class="page">
| <div class="head"><%=title%> - <%=path%></div>
| <div class="body">
| <ul>
| <% _(actions).each(function(action) { %>
| <li>
| <%=action.name%> - <%=Helpers.df(action.time)%>
| <% if (action.ext) { %>
| <i class="pop icon-info-sign" data-content="<%=_.template($('#extTpl').html(), action)%>" data-original-title="Extra Information"></i>
zipstream = require "zipstream"
fs = require "fs"
async = require "async"
class StreamingResponse
filename: ""
files: []
streaming: true
###