Skip to content

Instantly share code, notes, and snippets.

View brancusi's full-sized avatar
😍

Aram Zadikian brancusi

😍
View GitHub Profile
@brancusi
brancusi / rxstream.js
Created October 9, 2015 00:51
Rx.js mock
import React from 'react';
import Radium from 'radium';
import Publisher from 'components/widgets/ot/Publisher';
@Radium
export default class OTStreams extends React.Component {
static propTypes = {
session: React.PropTypes.object.isRequired,
}
@brancusi
brancusi / application.controller.js
Last active September 8, 2015 19:24
Gsap rxjs streams - Ember
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
viewState:'small',
actions:{
goLarge(){
this.set('viewState', 'large');
import Ember from 'ember';
export default Ember.Controller.extend({
captures: Ember.A(),
init: function(){
var self = this;
this.keyUps = Rx.Observable.fromEvent(document, 'keyup');
this.keyDowns = Rx.Observable.fromEvent(document, 'keydown');
@brancusi
brancusi / gist:859b92211f2ec704972d
Created August 13, 2015 19:16
gphoto2 - debug info
Arams-MacBook-Air:~ aram$ gphoto2 --shell --debug
0.000006 main (2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST:
0.000021 main (2): gphoto2 2.5.8
0.000025 main (2): gphoto2 has been compiled with the following options:
0.000039 main (2): + clang (C compiler used)
0.000042 main (2): + popt (mandatory, for handling command-line parameters)
0.000044 main (2): + no exif (for displaying EXIF information)
0.000047 main (2): + no cdk (for accessing configuration options)
0.000049 main (2): + no aa (for displaying live previews)
0.000051 main (2): + jpeg (for displaying live previews in JPEG format)
@brancusi
brancusi / gist:2c44de3bfac7c0af97d3
Created August 13, 2015 19:15
gphoto2 - capture-preview log
gphoto2: {/Users/aram} /> capture-preview
42.153558 gp_camera_init (2): Initializing camera...
42.153718 gp_libusb1_find_device_lib (2): Looking for USB device (vendor 0x4b0, product 0x42f)... found.
42.153802 gp_libusb1_find_device_lib (2): Detected defaults: config 1, interface 0, altsetting 0, inep 81, outep 02, intep 83, class 06, subclass 01
42.153818 gp_camera_init (2): Loading '/usr/local/Cellar/libgphoto2/2.5.8/lib/libgphoto2/2.5.8/ptp2'...
42.154625 gp_port_open (2): Opening USB port...
42.154648 gp_libusb1_open (2): ()
42.155019 gp_libusb1_open (2): claiming interface 0
42.156608 camera_init (2): maxpacketsize 512
42.156645 gp_port_set_timeout (2): Setting port timeout to 8000 milliseconds.
gphoto2: {/Users/aram} /> set-config manualfocusdrive=-20000
108.807599 camera_get_config (2): Getting function prop 'Bulb Mode' / 0x920c
108.807636 camera_get_config (2): Getting function prop 'Drive Nikon DSLR Autofocus' / 0x90c1
108.807659 camera_get_config (2): Getting function prop 'Drive Nikon DSLR Manual focus' / 0x9204
108.807677 camera_get_config (2): Getting function prop 'Set Nikon Autofocus area' / 0x9205
108.807691 gp_widget_set_value (2): Setting value of widget 'Set Nikon Autofocus area' to '0x0'...
108.807699 camera_get_config (2): Getting function prop 'Set Nikon Control Mode' / 0x90c2
108.807709 gp_widget_set_value (2): Setting value of widget 'Set Nikon Control Mode' to '0'...
108.807722 camera_get_config (2): Getting function prop 'Nikon Viewfinder' / 0x9201
108.807744 ptp_usb_sendreq (2): Sending PTP_OC 0x1015 / Get device property value request...
@brancusi
brancusi / .bash_profile
Created June 2, 2015 23:09
Bash Prompt - 2015
# Git branch in prompt.
function current_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
function formatted_git_prompt() {
if [ -n "$(current_git_branch)" ]; then
echo "[$(current_git_branch)]"
else
echo ""
@brancusi
brancusi / gist:2691778d9c878b6f7fe2
Created April 19, 2015 20:43
Any idea what's going on here?
import Ember from 'ember';
export default Ember.Service.extend({
//This throws an error: Uncaught TypeError: (intermediate value).property is not a function
// testProp:function(){
// return true;
// }.property(),
// This works though
function (user, context, callback) {
// if the user that just logged in has a refresh_token, persist it
if (user.refresh_token) {
user.persistent.refresh_token = user.refresh_token;
}
// IMPORTANT: for greater security, we recommend encrypting this value and decrypt on your application.
// function encryptAesSha256 (password, textToEncrypt) {
// var cipher = crypto.createCipher('aes-256-cbc', password);
function encryptAesSha256 (password, textToEncrypt) {
var cipher = crypto.createCipher('aes-256-cbc', password);
var crypted = cipher.update(textToEncrypt, 'utf8', 'hex');
crypted += cipher.final('hex');
return crypted;
}