Skip to content

Instantly share code, notes, and snippets.

View un33k's full-sized avatar
🎯
Focusing

Val Neekman un33k

🎯
Focusing
View GitHub Profile
@un33k
un33k / app.js
Created April 24, 2014 01:45 — forked from amineeg/app.js
'use strict';
// Declare app level module which depends on filters, and services
var app= angular.module('myApp', ['ngRoute']);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/login', {templateUrl: 'partials/login.html', controller: 'loginCtrl'});
$routeProvider.otherwise({redirectTo: '/login'});
}]);
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) {
$scope.$on('authLoaded', function() {
$scope.isExpert($scope.main.serieId);
$scope.isMember($scope.main.serieId);
});
$scope.loadAuth = function() {
Auth.load().success(function(data) {
$scope.main.user = data.user;
$scope.$broadcast("authLoaded");
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
import sys
ID_TOKEN = str(sys.maxint)
URLS = {}
class HyperlinkedIdentityField(serializers.HyperlinkedIdentityField):
"""
This is a performance wrapper for HyperlinkedIdentityField.
We save a ton of time by pre-computing the URL the first time it's
accessed, to save calling reverse potentially thousands of times
per request.
# Encrypt the repository
# Remove/modify this line if the repository is meant to be open-source
*.* filter=git-crypt diff=git-crypt
.gitattributes !filter !diff
# These files are text and should be normalized (Convert crlf => lf)
*.php text
*.css text
*.js text
*.htm text
#/bin/bash
active_id=$(printf "0x%08x\n" $(xdotool getactivewindow))
active_title=$(wmctrl -l | grep $active_id | awk '{for (i=4;i<=NF;++i)print $i}')
if $(echo $active_title | grep -q -i '\- Sublime Text$'); then
bash_title=$(wmctrl -l | grep -i 'st3_bash' | awk '{for (i=4;i<=NF;++i)print $i}')
wmctrl -a $bash_title
else

Angular2 + JSPM cheat sheet

First time setup

  • install jspm beta: npm install -g jspm@beta
  • set up your project: jspm init
  • install dependencies: jspm install angular2 reflect-metadata zone.js es6-shim

This will create a jspm_packages folder, and a config.js file.

Open the config.js file - this file manages options for the System.js loader - tweak it as appropriate

Angular2 + JSPM cheat sheet

First time setup

  • install jspm beta: npm install -g jspm@beta
  • set up your project: jspm init
  • install dependencies: jspm install angular2 reflect-metadata zone.js es6-shim

This will create a jspm_packages folder, and a config.js file.

Open the config.js file - this file manages options for the System.js loader - tweak it as appropriate

@un33k
un33k / sv-sign-up-form.jade
Last active August 29, 2015 14:27 — forked from SvitlanaShepitsena/sv-sign-up-form.jade
Lumx form (Tutorial: Advanced form validation with AngularJs using compile service. AngularJs tutorial )
div(flex-container='column')
.card
div(class='p+')
span.display-block.fs-title.mb {{title|translate}}
.divider.divider--dark
form.mt(name='signUpForm' novalidate sv-form-val)
div(flex-container='column' flex)
div(flex-item='')
lx-text-field(label='{{name|translate}}')
input(type='text'