This file contains 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
// Portable Wake-On-Lan by Lionello Lunesu, placed in the public domain | |
#ifdef _WIN32 | |
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <winsock2.h> | |
#ifdef _MSC_VER | |
#pragma comment(lib, "ws2_32.lib") | |
#endif | |
#else | |
#include <sys/socket.h> |
This file contains 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 <SoftwareSerial.h> | |
#include <Wire.h> | |
#include <SparkFunHTU21D.h> | |
#include<stdlib.h> | |
#include "DHT.h" | |
#define SSID "XinCheJian"//your network name |
This file contains 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
# nix-shell -p bundler bundix | |
# bundler lock && bundler package --path vendor/cache --no-install && bundix && exit | |
# nix-shell | |
with (import <nixpkgs> {}); | |
let | |
env = bundlerEnv { | |
name = "test-package"; | |
inherit ruby; | |
gemfile = ./Gemfile; | |
lockfile = ./Gemfile.lock; |
This file contains 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_nix() { | |
local shell_file=$(test -f shell.nix && echo shell.nix || echo default.nix) | |
local cache_key=$(nix-instantiate "$shell_file" 2> /dev/null | shasum -a 1 | cut -d ' ' -f 1) | |
# Use ram as virtualenv storage | |
local tmpdir | |
case $(uname -s) in | |
Linux*) tmpdir=$XDG_RUNTIME_DIR;; | |
Darwin*) tmpdir_SDK=$TMPDIR;; | |
*) tmpdir=/tmp |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 | |
# | |
# Cache nix-shell environment | |
# | |
# - watches shell.nix (or default.nix), ~/.direnvrc and .envrc | |
# - based on https://github.com/direnv/direnv/wiki/Nix | |
# | |
use_nix() { | |
local shell_file=$(test -f shell.nix && echo shell.nix || echo default.nix) | |
if [[ ! -f "$shell_file" ]]; then return; fi |
This file contains 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
{ pkgs ? import <nixpkgs> {} }: | |
let | |
inherit (pkgs) lib stdenv ruby_2_3 rake bundler bundlerEnv openssl defaultGemConfig; | |
rubyEnv = bundlerEnv { | |
name = "mezzo"; | |
ruby = ruby_2_3; | |
gemdir = ./.; |
This file contains 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
config dnsmasq | |
option domainneeded '1' | |
option boguspriv '1' | |
option filterwin2k '0' | |
option localise_queries '1' | |
option rebind_protection '1' | |
option rebind_localhost '1' | |
option local '/lan/' | |
option domain 'lan' | |
option expandhosts '1' |
This file contains 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
// | |
// RSASHA1.swift | |
// | |
// Copyright (c) 2015 Neil Cowburn. All rights reserved. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is |
This file contains 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
func keyCodeToString(keyCode: CGKeyCode) -> String { | |
let curKeyboard = TISCopyCurrentKeyboardInputSource().takeRetainedValue() | |
let ptr = TISGetInputSourceProperty(curKeyboard, kTISPropertyUnicodeKeyLayoutData) | |
let keyboardLayoutPtr = UnsafePointer<UCKeyboardLayout>(ptr) | |
var deadKeyState: UInt32 = 0 | |
var actualStringLength = 0 | |
var unicodeString = [UniChar](count: 255, repeatedValue: 0) | |
let status = UCKeyTranslate(keyboardLayoutPtr, |
OlderNewer