Skip to content

Instantly share code, notes, and snippets.

View tcdevs's full-sized avatar

TC Devs tcdevs

  • Technische Centrale
View GitHub Profile
@tcdevs
tcdevs / CDNfallback.js
Created June 3, 2013 06:39
HTML: jquery fallback
<!-- load Jquery remote with fallback to local -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
@tcdevs
tcdevs / data.json
Created June 3, 2013 06:43
Load a JSON data Object from another domain (with callback function)
jsonCallback(
{
"sites":
[
{
"siteName": "JQUERY4U",
"domainName": "http://www.jquery4u.com",
"description": "#1 jQuery Blog for your Daily News, Plugins, Tuts/Tips &amp; Code Snippets."
},
{
@tcdevs
tcdevs / loadJSONP.js
Created June 19, 2013 11:01
Howto load SJONP with angular's $http
app.controller('myController', function ($scope, $http ) {
$scope.fetch = function () {
$scope.url ="http://my-json-url.com";
$scope.status = null;
$scope.data = data;
var query = $scope.url + "&callback=JSON_CALLBACK";
$http({method: "JSONP", url: query}).
@tcdevs
tcdevs / all-fallbacks.html
Created June 21, 2013 08:12
List of all cdn fallbacks
<!-- Load JQuery remote or fallback to a local copy -->
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>window.jQuery || document.write("<script src='js/vendor/jquery-1.9.1.min.js'><\/script>")</script>
<!-- Load Bootstrap via CDN or fallback to a local copy -->
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<script>$.fn.modal || document.write("<script src='js/vendor/bootstrap.min.js'><\/script>")</script>
<!-- Load Angular via CDN or fallback to a local copy -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
@tcdevs
tcdevs / selectedIndex-Angular.html
Created June 24, 2013 11:52
Angular get slectedIndex
<div ng-app="">
<div ng-controller="Ctrl">
<ul class="nav nav-list" ng-repeat="color in colors">
<li ng-click="setSelectedIndex(color)" ng-class="{active: selectedItem == color}">
<a href="#">{{color}} {{$index}}</a>
</li>
</ul>
<tt>selectedItem = {{selectedItem}}</tt>
</div>
</div>

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after

A bunch of links to blog posts, articles, videos, etc for learning AngularJS. This list is in its early stages. Feel free to submit a pull request if you have some links/resources to add. Also, I try to verify that the articles below have some real content (i.e. aren't 2 paragraph blog posts with little information) to ensure I'm not listing "fluff" pieces. If you have an idea for a better way to organize these links, please let me know. As I find similar posts in the "General Topics" section, I will break them out into their own categories.

Books

@tcdevs
tcdevs / comment-end.xml
Created July 19, 2013 13:19
html comment end tag
<snippet>
<content><![CDATA[
<!-- /.${1:classname} -->
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ce</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>