Skip to content

Instantly share code, notes, and snippets.

View jerone's full-sized avatar

Jeroen van Warmerdam jerone

View GitHub Profile
@DanDiplo
DanDiplo / JS-LINQ.js
Last active April 23, 2024 11:03
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@jasesmith
jasesmith / AtomVerticalTabs.md
Last active November 23, 2019 09:40
Vertical file tab list in Atom

Vertical File Tabs in Atom

Add the styles to the .atom/styles.less stylesheet in Atom.

Atom Vertical File Tabs

@w8r
w8r / domtokenlist.js
Last active December 30, 2015 10:19
IE10+ DOMTokenList fix
/**
* IE 10 + supports ClassList, but the standards are vague. It is extremely
* convenient to add several classnames at once, FF and Chrome support that.
*
* @author Alexander Milevski <info@w8r.name>
*
* https://gist.github.com/w8r/fbdbfea078629ff913d4
*
* MIT License
*
@spiralx
spiralx / github-npm-autolink.user.js
Last active August 29, 2015 14:05
GitHub package.json dependency linker
@gabrielemariotti
gabrielemariotti / Readme.md
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@sindresorhus
sindresorhus / post-merge
Last active February 14, 2024 06:20
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@zgramana
zgramana / ToNSDictionary.cs
Created October 2, 2013 20:33
Quick n dirty function to convert a System.Json.JsonValue to an NSDictionary.
using System.Json;
...
var response = "{ \"foo\": \"bar\" }";
var jsonValue = JsonValue.Parse (response) as JsonObject;
// Split the lambda declaration and initialization
// so that we can do recursion;
Func<JsonValue, NSDictionary> toNSDictionary;
toNSDictionary = (obj)=> {
.col-ms-1,
.col-ms-2,
.col-ms-3,
.col-ms-4,
.col-ms-5,
.col-ms-6,
.col-ms-7,
.col-ms-8,
.col-ms-9,
.col-ms-10,
@rais38
rais38 / gist:5766980
Created June 12, 2013 16:35
Create patch from stash
git stash show -p stash@{0} > Stash0.patch
@triceam
triceam / gist:4658021
Created January 28, 2013 18:50
Detecting PhoneGap/Ripple emulator via JavaScript
myFunction( param ) {
var emulated = window.tinyHippos != undefined;
if ( emulated ){
//do something specific to emulated environment;
return;
}
///do something else...