Skip to content

Instantly share code, notes, and snippets.

View z3t0's full-sized avatar

Rafi Khan z3t0

View GitHub Profile
func TestInfo(t *testing.T) {
var information = Info()
fmt.Println(information)
// returns
// "Haxel Server Started..."
// "0.0.1"
if information == "Haxel Server Started ..." {// this should fail....
t.Error("Expected info, got", information)
}
Syntax checkers for buffer player_test.js in js2-mode:
javascript-eslint (disabled)
- may enable: Automatically disabled!
- executable: Not found
- config file: missing
javascript-jshint (disabled)
- may enable: Automatically disabled!
- executable: Not found
const http = require('http')
// queue
let queue = []
function httpget (i) {
http.get(process.argv[i + 2], (res) => {
let all = ''
res.on('data', (data) => {
#include <IRremote.h>
int IRPin = 12; // порт инфракрасного приёмника
IRrecv irrecv(IRPin);
decode_results results;
unsigned long micros_sp = 0;
volatile float sp; // мгновенная скорость
volatile float spAVG = 0; // средняя скорость
@z3t0
z3t0 / Portable Node.js andNPM on windows.md
Created February 4, 2017 05:08 — forked from massahud/Portable Node.js andNPM on windows.md
Portable Node.js and NPM on windows
  1. Get node binary (node.exe) from http://nodejs.org/download/
  2. Create the folder where node will reside and move node.exe to it
  3. Download the last zip version of npm from http://nodejs.org/dist/npm
  4. Unpack the zip inside the node folder
  5. Download the last tgz version of npm from http://nodejs.org/dist/npm
  6. Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
  7. Add the the node folder and the packages/bin folder to PATH
  8. On a command prompt execute npm install -g npm to update npm to the latest version

Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.

@z3t0
z3t0 / ans.py
Created January 31, 2017 06:55
def setup():
size(400, 400)
reset()
def keyPressed():
reset()
def reset():
background(51)
draw_once()
@z3t0
z3t0 / a.lua
Created January 27, 2017 02:53
function change_to_space(space)
-- already on space
if space == spaces.activeSpace() then
return
end
local new_space = get_spaces()[space]
print("changed")
if new_space ~= nil then
spaces.changeToSpace(new_space)
@z3t0
z3t0 / change.sh
Created January 21, 2017 06:22
change osx screenshot directory
# Screenshots will now be saved at ~/Document/screenshots
# the directory can be modified as you please
mkdir -p ~/Documents/screenshots
defaults write com.apple.screencapture location ~/Documents/screenshots
killall SystemUIServer
# Credits: http://www.idownloadblog.com/2014/06/15/how-to-change-where-screenshots-are-saved-on-mac/
fork(arg.script, arg.arg, {
cwd: message.item.plugin.path,
execArgv: arg.script
});
extension AXError: Error { }
// For some reason values don't get described in this enum, so we have to do it manually.
extension AXError: CustomStringConvertible {
fileprivate var valueAsString: String {
switch (self) {
case .success:
return "Success"
case .failure:
return "Failure"