Skip to content

Instantly share code, notes, and snippets.

View jerkovicl's full-sized avatar

Luka Jerković jerkovicl

View GitHub Profile
@jerkovicl
jerkovicl / example.js
Created September 20, 2013 16:22
Welcome to your first Gist! Gists are simple code reminders. Whenever you come across a piece of code you think might be useful later on, save it as a Gist. With GistBox, you can also tag the Gist with a label. This is especially useful for keeping them organized by language, project or purpose. For more info about GistBox, visit: http://www.gi…
// log an object to the browser console
console.log({ text: "foobar" });
function querySucceeded(data) {
var list = partialMapper.mapDtosToEntities(
manager, data.results, entityNames.speaker, 'id');
if (speakersObservable) {
speakersObservable(list);
}
log('Retrieved [Speaker] from remote data source',
data, true);
}
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-latest.min.js"></script>
<link href="//getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/2.0.1/js/toastr.min.js"></script>
<link href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/2.0.1/css/toastr.min.css" rel="stylesheet"/>
<script src="//getbootstrap.com/dist/js/bootstrap.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
@jerkovicl
jerkovicl / app.js
Created November 5, 2013 14:28 — forked from nervetattoo/app.js
define(['dependency'], function(Dependency)
{
console.log("Dependency loaded", Dependency);
});
@jerkovicl
jerkovicl / README.md
Last active December 28, 2015 16:18 — forked from JoelBesada/README.md

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
//detects whether the app is running on an iOS device, then whether the version of iOS is 7 or greater.
//If so, margin-top workaround is applied.
//it is safe to place anywhere in the <body>.
//if your application uses a fixed header this fix will not work
var updateStatusBar = navigator.userAgent.match(/iphone|ipad|ipod/i) &&
parseInt(navigator.appVersion.match(/OS (\d)/)[1], 10) >= 7;
if (updateStatusBar) {
<!DOCTYPE html>
<html>
<head>
<script src="http://github.hubspot.com/offline/offline.min.js"></script>
<script src="http://github.hubspot.com/offline/js/snake.js"></script>
<link rel="stylesheet" href="http://github.hubspot.com/offline/themes/offline-theme-chrome.css" />
<script>
Offline.options = {
module.exports = function(grunt) {
// configure the tasks
grunt.initConfig({
copy: {
build: {
cwd: 'source',
src: [ '**', '!**/*.styl', '!**/*.coffee', '!**/*.jade' ],
dest: 'build',
<!DOCTYPE html>
<html>
<head>
<title>InAppBrowser Tester</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="kendo/styles/kendo.mobile.all.min.css" rel="stylesheet">
<link href="styles/main.css" rel="stylesheet">
@jerkovicl
jerkovicl / JS_snippets.md
Last active November 23, 2016 04:15
Collection of some usefull JS snippets

JS Snippets

Registering a custom html5 data-* attribute

<div data-onload="sampleFunction('param1', 2)"></div>
/* Find any element which has a 'data-onload' function and load that to simulate an onload. */