Skip to content

Instantly share code, notes, and snippets.

@theJenix
theJenix / reflect.py
Created September 21, 2023 04:53 — forked from 1kastner/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from http.server import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@theJenix
theJenix / index.js
Created June 22, 2023 00:34
sandwich-ipsum
const express = require('express');
const loremIpsum = require('lorem-ipsum').loremIpsum;
const app = express();
const port = 3000;
// Sandwich Ipsum words
const sandwichWords = [
'lettuce', 'tomato', 'cheese', 'bacon', 'mayonnaise',
'mustard', 'ham', 'turkey', 'pickles', 'onion',
#!/usr/bin/env python3
"""Print emails from a given date interval.
Usage:
$ %(prog)s <since_date> <before_date>
since_date < before_date
Date format: DD-Mon-YYYY e.g., 3-Mar-2014

How do I get string content from Haxe to an untyped cpp block?

static public function haxeFunction(inputString:String)
{
  untyped __cpp__ ('
  
      myStruct myFoo;       
      myFoo.data = ???;   //Should be the string contents of Haxe String inputString (1st 16 characters, ASCII only is fine)
 
import haxe.macro.Expr;
import haxe.macro.Context;
class Build {
static public function types() {
var pos = Context.currentPos();
function mkPath(name:String):TypePath {
var parts = name.split('.');
return {
sub: null,
@theJenix
theJenix / haxe-unzip-example.hx
Created October 30, 2020 15:22 — forked from ruby0x1/haxe-unzip-example.hx
Unzip a file with haxe - example
public static function unzip( _path:String, _dest:String, ignoreRootFolder:String = "" ) {
var _in_file = sys.io.File.read( _path );
var _entries = haxe.zip.Reader.readZip( _in_file );
_in_file.close();
for(_entry in _entries) {
var fileName = _entry.fileName;
{
"rust-analyzer.checkOnSave.command": "clippy"
}

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@theJenix
theJenix / nginx.conf
Created January 2, 2020 21:20 — forked from dctrwatson/nginx.conf
Caching NPM proxy using Nginx
user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@theJenix
theJenix / mock.py
Created November 13, 2017 06:06
f360_mock.py
import sys
import inspect
import unittest
import unittest.mock
from . import patch
class EnhancedMock(unittest.mock.Mock):
""" An enhanced mock object that supports a wider array of mock patching than the base framework.