Skip to content

Instantly share code, notes, and snippets.

View Werninator's full-sized avatar
👀

Patrick Werner Werninator

👀
  • Germany
View GitHub Profile
@Werninator
Werninator / Sublime Text Shortcuts
Created August 6, 2014 09:26
Sublime Text Cheat Sheet für Shortcuts
Sublime Text - Shortcuts und Funktionen
/*
Sublime Spezifisches
*/
CMD + , => User Prefs als JSON-String
CMD + SHIFT + P => Alle Optionen von Addons und Sublime Text
"pain" zum Installieren von Plugins
@Werninator
Werninator / HoverScript.html
Last active August 29, 2015 14:05
Kleines Script zum triggern von Dropdowns. Nutzt jQuery.
<script type="text/javascript">
jQuery(function($) {
// Timervariable für die setTimeout-Funktion
var timer;
/* Änderbare Daten: */
// Klassennamen
var hoverBox = '.hoverBox';
@Werninator
Werninator / umwandlungen.js
Last active August 29, 2015 14:07
Umwandlungen in Javascript
// * zu String
var floatValue = 100.1;
var stringValue = floatValue + '';
// String zu Zahl
var stringValueAsFloat = parseFloat(stringValue);
var stringValueAsInt = parseInt(stringValue, 10);
// Solche Werte können nicht direkt verwendet werden, einfach das Komma replacen
var deutschFormatierterString = "13,37";
@Werninator
Werninator / hasNumber.js
Created October 16, 2014 07:36
Überprüft ob ein String eine Zahl enthält
/**
* hasNumber()
* Überprüft ob ein String eine Zahl enthält
*
* @type {String} str
* @return {boolean}
*/
function hasNumber(str) {
var regex = /\d/;
@Werninator
Werninator / ffAccordion.js
Last active August 29, 2015 14:13
Accordion Script mit jQuery
(function($) {
$.fn.ffAccordion = function(options) {
if (typeof options == 'undefined')
options = {};
options = {
childSelector: options.childSelector || 'li',
subMenuSelector: options.subMenuSelector || 'ul',
@Werninator
Werninator / forcedDownloads.php
Created July 1, 2015 09:12
Forced Downloads mit PHP
<?php
$filename = 'mein-export.csv';
$content = '1,2,3,4,5';
// Header setzen
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
@Werninator
Werninator / ngEnter.js
Last active March 3, 2016 14:51 — forked from EpokK/ngEnter.js
ngEnter directive for AngularJS
app.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind('keydown keypress', function(event) {
if (event.which !== 13)
return;
scope.$apply(function() {
scope.$eval(attrs.ngEnter);
});
@Werninator
Werninator / my-sublime-text-config.json
Last active March 21, 2016 15:01
my sublime text configuration
{
"bold_folder_labels": true,
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"draw_minimap_border": true,
"draw_white_space": "all",
"font_face": "SourceCodePro-Regular",
"font_size": 11,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
@Werninator
Werninator / giphy-reactions.txt
Last active May 19, 2016 08:15
giphy reactions for slack
/giphy spooky fist pump
/giphy bacon burger reaction
/giphy let your pussy go
/giphy lolwut stunned what shocked huh
/giphy dance faggot dance
/giphy doge dance halloween
@Werninator
Werninator / ngrChange.js
Last active May 31, 2016 16:04
ngrChange - ng REAL change - only trigger change on value change at pressing enter or blur out.
app.directive('ngrChange', function() {
return {
require: 'ngModel',
link: function (scope, element, attrs) {
var valueBefore = element.val();
element.bind('focus', function() {
if (valueBefore !== element.val())
valueBefore = element.val();
});