Skip to content

Instantly share code, notes, and snippets.

View Freundschaft's full-sized avatar

Qiong Wu Freundschaft

View GitHub Profile
@Freundschaft
Freundschaft / serial
Last active April 20, 2018 02:22
serial
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO.Ports;
namespace ConsoleApplication2
{
class Program
server {
# Internal image resizing server.
server_name localhost;
listen 8888;
location ~* ^.+\.(jpeg|gif|png|jpg) {
image_filter_buffer 20M;
image_filter resize 450 -;
image_filter_jpeg_quality 95;
image_filter_interlace on;
@Freundschaft
Freundschaft / NfcWifiProtectedSetup.js
Created November 30, 2016 17:47
NfcWifiProtectedSetup created by Freundschaft - https://repl.it/E4HO/63
//parsing according to https://android.googlesource.com/platform/packages/apps/Nfc/+/master/src/com/android/nfc/NfcWifiProtectedSetup.java
//additions according to WIFi Alliance Wi-Fi Protected Setup Specification
//sample payload
var u8 = new Uint8Array([16,14,0,62,16,38,0,1,1,16,69,0,11,87,76,65,78,45,56,50,67,81,90,54,16,3,0,2,0,34,16,15,0,2,0,12,16,39,0,16,52,57,53,54,52,52,53,54,56,48,51,57,48,50,54,51,16,32,0,6,-1,-1,-1,-1,-1,-1]);
function bin2string(array){
var result = "";
for(var i = 0; i < array.length; ++i){
result+= (String.fromCharCode(array[i]));
@Freundschaft
Freundschaft / helloworld.js
Last active November 30, 2016 12:16
hello world
const http = require('http');
const hostname = '0.0.0.0';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
@Freundschaft
Freundschaft / keybase.md
Created October 2, 2016 19:56
keybase.md

Keybase proof

I hereby claim:

  • I am freundschaft on github.
  • I am freundschaft (https://keybase.io/freundschaft) on keybase.
  • I have a public key whose fingerprint is 0F4A 6560 FF22 5634 715D 9C55 7AF8 8862 7F86 3F7B

To claim this, I am signing this object:

@Freundschaft
Freundschaft / gist:27a843f3405643f859e6
Last active April 4, 2016 08:17
multiple-date-picker with date range selection (unstructured)
/*
@author : Maelig GOHIN For ARCA-Computing - www.arca-computing.fr
@date: January 2016
@version: 1.4.0
@description: MultipleDatePicker is an Angular directive to show a simple calendar allowing user to select multiple dates.
Css style can be changed by editing less or css stylesheet.
See scope declaration below for options you can pass through html directive.
Feel free to edit and share this piece of code, our idea is to keep it simple ;)
*/
@Freundschaft
Freundschaft / datepicker.js
Created February 8, 2016 14:01
datepicker stub
'use strict';
angular.module('roadatlasApp')
.directive('datepicker', function (DateUtilities) {
return {
restrict: 'EA',
templateUrl: 'views/directives/datepicker.html',
replace: true,
scope: {
stopover: '=',
stopovers: '=',