This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# To use add to `.git/hooks/` | |
# Should be named `pre-push` | |
# Make executable with `chmod +x` | |
# ref: https://gist.github.com/maks/edb25da8706cb04f45ebfdd278d91791 | |
# run Flutter analyze + test | |
flutter analyze | |
if [ $? -ne 0 ]; then | |
echo 'cannot push: Flutter analyze failed' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# To run, download the script or copy the code to a '.sh' file (for example 'flutterrepair.sh') and run like any other script: | |
# sh ./flutterrepair.sh | |
# or | |
# sudo sh flutterrepair.sh | |
echo "Flutter Repair (by jeroen-meijer on GitHubGist)" | |
echo Cleaning project... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sam016.vsflatomation.service.ble; | |
import java.util.HashMap; | |
import java.util.UUID; | |
public class AllGattCharacteristics { | |
private static HashMap<String, String> attributes = new HashMap(); | |
static { | |
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name"); |
This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.
To use the script, follow the instructions given in the script's docstring.
For further details, read this blogpost.
The procedure outlined here is inspired by this answer on Stack Overflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; | |
import io.realm.RealmObject; | |
import io.realm.RealmResults; | |
public abstract class RealmAdapter<E extends RealmObject, VH extends RealmAdapter.ViewHolder> | |
extends BaseAdapter { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TODO : | |
- manage user notification ; notify-send not really working ; current alternative either. | |
- display hostid used to customize usb backup script. | |
INSTALL | |
- copy usb-auto-backup script to /usr/local/bin, | |
- create an partition on an USB drive named "backup" ; get id (/dev/sddX) -> will be needed in udev.rules | |
- identity your drive information for UDEV-rules using : udevadm info -a -p $(udevadm info -q path -n /dev/sdXX) | |
- create an UDEV rule : /etc/udev/rules.d/99-usb-auto-backup.rules like this one : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippet find | |
GameObject.Find("${1}")${2} | |
snippet gc | |
GetComponent<${1}>() | |
snippet ac | |
AddComponent<${1}>() | |
snippet sar | |
SetActiveRecursively(${1:true}) | |
snippet rc | |
[RequireComponent (typeof(${1:AudioSource}))] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Built with IMPACT - impactjs.org | |
(function (window) { | |
"use strict"; | |
Number.prototype.map = function (istart, istop, ostart, ostop) { | |
return ostart + (ostop - ostart) * ((this - istart) / (istop - istart)); | |
}; | |
Number.prototype.limit = function (min, max) { | |
return Math.min(max, Math.max(min, this)); | |
}; | |
Number.prototype.round = function (precision) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class WikipediaMarkupCoordinates{ | |
/** | |
* @param string $text | |
* @return boolean|array | |
* | |
* bsp: http://de.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&titles=Berufskolleg_Deutzer_Freiheit | |
*/ | |
public static function parseCoordinatesFromInfobox($text) { |
NewerOlder