Skip to content

Instantly share code, notes, and snippets.

@timelf123
timelf123 / helipads.cpp
Created August 31, 2016 00:21 — forked from raws/helipads.cpp
Useful ArmA 3 debug console snippets
// Mark locations of nearby helipads
{
_marker = createMarkerLocal [(format ["helipad_%1", ([0, 1000] call BIS_fnc_randomInt)]), (position _x)];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "hd_dot";
_marker setMarkerColor "ColorRed";
} forEach (nearestObjects [player, {"Land_helipadEmpty_F"}, 250]);
@timelf123
timelf123 / pre-commit
Created August 23, 2016 13:57 — forked from MarcoPriebe/pre-commit
pre-commit git hook to remove trailing whitespace
#!/bin/bash
#
# A git hook script to find and fix trailing whitespace
# in your commits. Bypass it with the --no-verify option
# to git-commit
#
# Logic:
#
# The 'git stash save' fails if the tree is clean (instead of
# creating an empty stash :P). So, we only 'stash' and 'pop' if
@timelf123
timelf123 / gist:466185da57a82f3b72e5cbbb118465fc
Created August 16, 2016 18:17 — forked from dgieselaar/gist:8b20e9d593e1806a098b
Code splitting, lazy-loading, import statements, Angular + newNgRouter + ocLazyLoad + webpack
import _ from 'lodash';
import angular from 'angular';
import 'angular-new-router';
import 'oclazyload';
function AppController ( ) {
}
AppController.$routeConfig = [];
@timelf123
timelf123 / pr.md
Created July 29, 2016 13:39 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@timelf123
timelf123 / clickable-element.html
Created March 29, 2016 14:20 — forked from scottmagdalein/clickable-element.html
Make the Mailchimp Subscriber popup appear on click
<!-- This is the HTML element that, when clicked, will cause the popup to appear. -->
<button id="open-popup">Subscribe to our mailing list</button>
@timelf123
timelf123 / duplicateRequestsFilter.js
Created March 15, 2016 22:43 — forked from adamreisnz/duplicateRequestsFilter.js
An AngularJS $http decorator to filter duplicate requests
/**
* Module definition and dependencies
*/
angular.module('Api.DuplicateRequestsFilter.Decorator', [])
/**
* Config
*/
.config(function($provide) {
git clone git://github.com/sivel/speedtest-cli.git speedtest-cli
@timelf123
timelf123 / gource.sh
Created January 15, 2016 05:52 — forked from XueshiQiao/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
@timelf123
timelf123 / linkedin-query.py
Created January 13, 2016 03:01 — forked from rvanbruggen/linkedin-query.py
Python script to query your LinkedIn network and get all your network's connections and their interconnections.
#!/usr/bin/env python
# encoding: utf-8
"""
linkedin-query.py
Created by Thomas Cabrol on 2012-12-03.
Customised by Rik Van Bruggen
Copyright (c) 2012 dataiku. All rights reserved.
Building the LinkedIn Graph
@timelf123
timelf123 / WebSockets.md
Created January 4, 2016 02:26 — forked from subudeepak/WebSockets.md
The problems and some security implications of websockets - Cross-site WebSockets Scripting (XSWS)

WebSockets - An Introduction

WebSockets is a modern HTML5 standard which makes communication between client and server a lot more simpler than ever. We are all familiar with the technology of sockets. Sockets have been fundamental to network communication for a long time but usually the communication over the browser has been restricted. The general restrictions

  • The server used to have a permanent listener while the client (aka browser) was not designated any fixed listener for a more long term connection. Hence, every communication was restricted to the client demanding and the server responding.
  • This meant that unless the client requested for a particular resource, the server was unable to push such a resource to the client.
  • This was detrimental since the client is then forced to check with the server at regular intervals. This meant a lot of libraries focused on optimizing asynchronous calls and identifying the response of asynchronous calls. Notably t