Skip to content

Instantly share code, notes, and snippets.

@iOnline247
iOnline247 / robot.js
Created December 3, 2012 17:20
W00t #1 YEAH!!!! (Zolmesiter)
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
//robot.turnGunRight(90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
if (robot.parentId) {
@iOnline247
iOnline247 / flatten.js
Created April 27, 2016 16:08 — forked from thetutlage/flatten.js
Flatten an array in Javascript without recursion
'use strict'
var Benchmark = require('benchmark')
var suite = new Benchmark.Suite;
var list = [1, 2, 3, [[4]], [[[5]]], [6], [[7]]]
function flattenRecursive (list) {
var flatList = []
list.forEach(function (item) {
@iOnline247
iOnline247 / downloadAllYammerFiles.js
Last active June 21, 2016 13:20 — forked from PCfromDC/downloadAllYammerFiles.js
Download All Yammer Files
function getDownloadLink(el, i) {
'use strict';
var rlastForwardSlash = /.+\//,
fileId = (el.href) ? el.href.replace(rlastForwardSlash, '') : '',
downloadPath = 'https://www.yammer.com/api/v1/uploaded_files/' + fileId + '/download'
;
return downloadPath;
}
function downloadFile(dataUrl) {
'use strict';
@iOnline247
iOnline247 / package.json
Created July 12, 2016 21:50 — forked from addyosmani/package.json
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js'",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",

ServiceWorker for github pages

This is a ServiceWorker template to turn small github pages into offline ready app.

Why ?

Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html file with all the nessesary CSS and JavaScript in it (or maybe 2-3 html/css/js files). I wanted to cache these files so that I can access my tools offline as well.

Notes

Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS of your repository.

@iOnline247
iOnline247 / AppOnly-ACS-PowerShell-Sample.ps1
Created January 11, 2017 03:53 — forked from wictorwilen/AppOnly-ACS-PowerShell-Sample.ps1
SharePoint Online: App Only policy PowerShell tasks with ACS
# For more information see: http://www.wictorwilen.se/sharepoint-online-app-only-policy-powershell-tasks-with-acs
$clientId = "<INSERT YOUR CLIENT ID HERE>"
$secret = "<INSERT YOUR CLIENT SECRET HERE>";
$redirecturi = "<INSERT YOUR REDIRECT URI HERE>"
$url = "https://<TENANT>.sharepoint.com/sites/contoso/"
$domain = "<TENANT>.sharepoint.com"
$identifier = "00000003-0000-0ff1-ce00-000000000000"
@iOnline247
iOnline247 / ohmyposhv3-v2.json
Last active September 2, 2022 12:39 — forked from shanselman/ohmyposhv3-v2.json
ohmyposhv3-v2
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#00c7fc",
"foreground": "#000000",
"style": "diamond",