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
# This commandline removes all tabs from a directive template file, then adds '"' at the beginning of every line, '" +' at the end of every line, then replaces 'templateUrl' in directive file with the new contents of the template. | |
# This is very useful when an originally externalized template file for a AngularJS directive needs to be inline for e.g. minimizing. The original template file is no longer needed. | |
sed -e 's/^[ \t]*//' -e 's/\"/\\\"/g' -e 's/^/"/g' -e 's/$/" +/g' -e '1 i\template: \"\" +' -e "\$a\"\"," TEMPLATE.html > TEMPLATE.html.tmp && sed -e '/templateUrl/{r TEMPLATE.html.tmp' -e 'd}' DIRECTIVE.js > DIRECTIVE-tpl.js && rm TEMPLATE.html.tmp | |
# EXAMPLE: | |
############################################################ | |
# DIRECTIVE.js: |
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
# Everytime I clone a new GIT repo I always forget to set the user information to the specific values (privat, company, whatever) | |
# This entry in my .gitconfig prevents commiting as long I have not edited the local .git/config | |
# | |
# This workaround is based on the following stack-overflow question: http://stackoverflow.com/a/25050535 | |
[user] | |
email = (none)\n\n\n====================================\n!!! E-MAIL NOT SET FOR THIS REPO !!!\n!!! Specify your name and e-mail !!!\n====================================\n\n\n | |
name = Firstname Lastname | |
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
# Show all bower packages of a project which can be updated | |
# Displays package name, current and latest version in a nice table | |
# Note: give bower some time to fetch the version information | |
bower list | grep latest | sed -e 's/[^#a-zA-Z0-9.+ ()-]//g' -e 's/^[[:space:]]*//g' | sort -u | sed -e 's/ (/#(/g' | tr -d '()' | sed -e 's/#latest is /#/g' | sed '1 i\Module Name#Current#Latest Version' | column -t -s'#' | |
# EXAMPLE: | |
# |
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
// ==UserScript== | |
// @name Maillist fix | |
// @namespace test | |
// @include http://lists-dev.cloud.fedoraproject.org/archives/list/kde%40lists.fedoraproject.org/thread/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
$(".col-sm-9").removeClass("col-sm-9") | |
$(".col-sm-2").addClass("col-sm-1") |
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
'use strict'; | |
/** | |
* Moveable modal | |
* | |
* You need to set the options of the provider. | |
* | |
* Requirements: | |
* | |
* You need angular-ui/bootstrap module |
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
<html><head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.3.0/min/dropzone.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.navigate.min.js"></script> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.3.0/min/dropzone.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css"> |
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/bash | |
# Adapted from Erik Johnson's script at | |
# http://terminalmage.net/2011/11/17/setting-a-usb-headset-as-the-default-pulseaudio-device/ | |
# | |
# Updated by Edward Faulkner <[email protected]> to move existing | |
# streams and eliminate the extra fork script. | |
# You'll need to change these to point at your headset device. | |
OUTPUT="alsa_output.usb-Generic_FREETALK_Everyman_0000000001-00-Everyman.analog-stereo" |
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/bash | |
API_TOKEN="<TOKEN>" | |
API_URL="https://gitlab.com/api/v4" | |
for PROJECT_ID in {1..260}; do | |
echo "Working on Project: $PROJECT_ID" | |
for BRANCH in `curl -s --header "PRIVATE-TOKEN: ${API_TOKEN}" "${API_URL}/projects/${PROJECT_ID}/protected_branches" | jq -r ".[]|.name?"`; do | |
echo $BRANCH | |
curl -s --request DELETE --header "PRIVATE-TOKEN: ${API_TOKEN}" "${API_URL}/projects/${PROJECT_ID}/protected_branches/${BRANCH}" |
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/bash | |
API_TOKEN="<TOKEN>" | |
API_URL="https://gitlab.com/api/v4" | |
GL_GROUPS=( 16 27 33 36 ) | |
for PROJECT_ID in {1..260}; do | |
echo "Working on Project: $PROJECT_ID" | |
for GL_GROUP in "${GL_GROUPS[@]}"; do |
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
# Place in ~/.local/share/kservices5/ServiceMenus/uto.desktop, remove this line | |
[Desktop Action Edit] | |
Exec=$HOME/bin/uto "%U" | |
Icon=goa-account-owncloud | |
Name=Upload to Owncloud | |
[Desktop Entry] | |
Actions=Edit | |
Icon=goa-account-owncloud |