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
| /* ---- | |
| css custom properties to manipulate color | |
| MIT - 2017 - Soft Punch | |
| https://gist.github.com/softpunch/ | |
| set initial "main" color via HSL values. | |
| automatically calculate harmonies and variations of that color with pure css. | |
| harmonies are determined solely by hue. |
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
| const db = require('../config/mysql')(); | |
| function doSomething() { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => resolve(), 5000); | |
| }); | |
| } | |
| function loopImages(images) { | |
| return new Promise((resolve, reject) => { |
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
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #include <netinet/tcp.h> | |
| #include <sys/socket.h> | |
| #include <sys/types.h> | |
| #include <netinet/in.h> |
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
| Object.prototype.clear = function () { | |
| while(this.firstChild) { | |
| this.removeChild(this.firstChild); | |
| } | |
| return this; | |
| }; | |
| const build = function (data) { | |
| const article = document.createElement('article'); | |
| const heading = document.createElement('h1'); |
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
| iptables -A INPUT -p tcp --dport 2299 -m state --state NEW -m recent --set --name ssh --rsource | |
| iptables -A INPUT -p tcp --dport 2299 -m state --state NEW -m recent ! --rcheck --seconds 60 --hitcount 4 --name ssh --rsource -j ACCEPT |
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
| // Restify Server CheatSheet. | |
| // More about the API: http://mcavage.me/node-restify/#server-api | |
| // Install restify with npm install restify | |
| // 1.1. Creating a Server. | |
| // http://mcavage.me/node-restify/#Creating-a-Server | |
| var restify = require('restify'); |
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
| { | |
| "extends": "eslint:recommended", | |
| "env": { | |
| "es6": true, | |
| "node": true | |
| }, | |
| "parserOptions": { | |
| "ecmaVersion": 6 | |
| }, | |
| "rules": { |
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 | |
| require_once 'functions.php'; | |
| if (requestMethodCheck('GET')) { | |
| $myArray = getRequestArray(INPUT_GET); | |
| $name = $myArray['name']; | |
| $origin = $_SERVER['HTTP_REFERER']; | |
| $ip = $_SERVER['REMOTE_ADDR']; |
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 | |
| function requestMethodCheck($method) { | |
| $requestMethod = filter_input(INPUT_SERVER, 'REQUEST_METHOD', FILTER_SANITIZE_SPECIAL_CHARS); | |
| if ($requestMethod === $method) { | |
| return true; | |
| } else { | |
| return false; | |
| } | |
| } |
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
| myRandomNumber = Math.floor(Math.random() * myArray.length) | |
| myRandomItem = myArray[myRandomNumber] | |
| document.write(myRandomItem) | |
| xhr = new XMLHttpRequest() | |
| url = "http://localhost/undervisning/reklamer/statistik.php" | |
| xhr.open("POST", url, true) | |
| xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded") | |
| xhr.onreadystatechange = function () { | |
| if (xhr.readyState == 4 && xhr.status == 200) { |
NewerOlder