Skip to content

Instantly share code, notes, and snippets.

View csanz's full-sized avatar
🎯
Focusing

Christian Sanz csanz

🎯
Focusing
View GitHub Profile
@csanz
csanz / sample-anyproxy-rule-for-son.js
Created April 17, 2020 18:21
Rule I created to block some sites on my son's computer at home.
/*
sample:
redirect all https://www.roblox.com/t requests to http://localhost:3000/
redirect all https://www.roblox.com/t requests to http://localhost:3000/
test:
curl https://www.roblox.com/ --proxy http://192.168.1.84:8001
curl https://www.yahoo.com/ --proxy http://192.168.1.84:8001
expected response:
@csanz
csanz / mac-osx-system-proxy-via-terminal.md
Created April 16, 2020 23:03
Updating Mac OSX System Proxy via Terminal

Updating Mac OSX Proxy via the Terminal

I'm using AnyProxy to block websites on my son's computer. I also use it block safe websites like roblox or youtube, just so he can do his home work... Right now i"m seeting up a proxy with some rules and I go and ssh to turn the proxy on and off... I found this last night at 2am and put it on a gitst, but I'll make it public now.

You simply just use the networksetup command. You can find the params you need to you this way

networksetup -setwebproxy | grep "setproxy"

networksetup -setwebproxy

@csanz
csanz / DeliveryArchitect.md
Last active January 20, 2020 22:40
Delivery Architect

Senior /Lead Delivery Architect

we are looking for a seasoned nodejs and linux engineer/leader who can help us take our web technology to the next level of scale

your focus will be to:

  • Assure things are being built the right way (reusable code, project/library structure, database schema, authentication flow, unit tests, documentation, patterns, etc)
  • Assure best practices are enforced (logging, error messaging, unit testing, etc)
  • Assure releases go out on time (deployment process, QA, documentation, communication across departments)
@csanz
csanz / check_for_changes2.sh
Created May 6, 2019 21:30
Another way to check if the repo was updated.
# picked up from stackoverflow
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")
if [ $LOCAL = $REMOTE ]; then
echo "Up-to-date"
elif [ $LOCAL = $BASE ]; then
@csanz
csanz / check_for_changes.sh
Created May 6, 2019 17:42
check if you need to pull new version from branch
#!/bin/sh
git fetch --quiet
CHANGES=(`git rev-list HEAD..origin/production --count`)
echo $CHANGES
# now you can check if the value is higher than 0, if yes, then you can git pull
/*
Some suodo code snippets for superhuman future API
To run code:
[COMMAND] + K
- Connect github repo
- View/Edit CRON jobs
@csanz
csanz / launch_sublime_from_terminal.markdown
Created January 17, 2019 06:53 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@csanz
csanz / AIPseudo.py
Last active September 19, 2017 16:30
# COLLECT / TRAIN
from skycatch import drone, ai
async def run():
try:
collection =
await drone.runCollection()
await
ai.train.labeling_queue(collection.data)
except Exception as exc:
print('Internal collection '
/*
IMPEACHMENT SCRIPT
Author: The American People with a conscious
*/
var candidate = candidates.getLeastQualified()
var POTUS = new POTUS(candidate)
If(POTUS.name=="trump"){
// send to hell
thisIsHell(POTUS);
{
"name" : "cool project"
, "version" : "0.1.8"
, "dependencies": {
"express" : "2.5.4"
, "express-messages" : "0.0.x"
, "express-resource" : "0.2.4"
, "express-mongoose" : "0.0.x"
, "express-expose" : "0.2.2"
, "stylus" : "0.13.x"