Skip to content

Instantly share code, notes, and snippets.

View bwnyasse's full-sized avatar
🎯
Focusing

Boris-Wilfried bwnyasse

🎯
Focusing
View GitHub Profile
@bwnyasse
bwnyasse / .gitignore
Created March 5, 2017 21:30 — forked from jonathandixon/.gitignore
Cordova CLI project .gitignore and helper script. Useful when you don't want to commit the platforms and plugins directories to version control. http://stackoverflow.com/q/17911204/417568
platforms/
plugins/
@bwnyasse
bwnyasse / extract-git-folder-with-history.md
Created August 9, 2016 22:56 — forked from cyberang3l/extract-git-folder-with-history.md
GIT: How to extract a specific folder from a git repository branch, including the folder's related git history only

GIT: How to extract a specific folder from a git repository branch, including the folder's related git history only

NOTE: If you want to keep the history for a specific folder in the master branch, just skip steps in lines 3,4,5,6,7

git clone <git-repository-url>
cd <git-repository-dir>

git checkout <branch-name>              # line 3; Checkout the branch of interest
git merge --strategy=ours master        # line 4; keep the content of this branch only and record a merge
git checkout master                     # line 5; Go back to the master branch
@bwnyasse
bwnyasse / main.dart
Created August 8, 2016 21:41 — forked from anonymous/main.dart
Sample use case Regular Expression 
void main() {
///
/// sample using regexp to parse log
///
RegExp regExp = new RegExp(r"^(.*m)(\d{1,2}:\d{1,2}:\d{1,2},\d{1,3}) ([^\s]+) (.*)");
var input ="""
[0m[31m22:25:57,366 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."bad.war"
""";
var matches = regExp.allMatches(input);
@bwnyasse
bwnyasse / apt-remove-duplicate-source-entries.py
Created May 22, 2016 22:22 — forked from davidfoerster/gist:780daa8086b924b1837a06cc486af672
Detect and deactivate duplicate Apt source entries (as requested in https://askubuntu.com/a/762815/175814).
#!/usr/bin/env python3
"""
Detects and interactively deactivates duplicate Apt source entries.
Usage: python3 apt-remove-duplicate-source-entries.py
"""
from __future__ import print_function
import aptsources.sourceslist
@bwnyasse
bwnyasse / tmux-cheatsheet.markdown
Created April 27, 2016 20:17 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@bwnyasse
bwnyasse / camera.html
Created March 22, 2016 08:35 — forked from dhavaln/camera.html
Phonegap Camera Capture Example
<!DOCTYPE html>
<html>
<head>
<title>Capture Photo</title>
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"/>
<script type="text/javascript" charset="utf-8" src="js/phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
var pictureSource; // picture source
var destinationType; // sets the format of returned value
[
{ "keys": ["f12"], "command": "htmlprettify"},
{ "keys": ["f1"], "command": "fold" },
{ "keys": ["f2"], "command": "unfold" },
{ "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
{ "keys": ["ctrl+space"], "command": "auto_complete" },
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
[
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },