Skip to content

Instantly share code, notes, and snippets.

View OmgImAlexis's full-sized avatar
🇹🇼

Alexis Tyler OmgImAlexis

🇹🇼
View GitHub Profile
@eclarke
eclarke / toggleproxy.sh
Last active August 29, 2015 13:57
A hackety hack function to toggle SSH/SOCKS proxy on OS X Mavericks
function toggleproxy {
# checks to see if SOCKS proxy is enabled
if [[ $(networksetup -getsocksfirewallproxy Wi-Fi | grep '^Enabled') == "Enabled: No" ]]; then
networksetup -setsocksfirewallproxystate Wi-Fi on
echo "SOCKS on!"
# checks to see if there's an existing SSH tunnel and if not, it starts one
if [[ -z $(ps aux | grep '[0-9] ssh -D 8080') ]]; then
echo -ne "Don't see a ssh tunnel on 8080 active, starting one now..."
ssh -D 8080 -f -C -q -N USERNAME@HOSTNAME.EDU # Change this from the defaults!
[[ $? == 0 ]] && echo " success!" || echo " failed :("
#!/usr/local/bin/bash
source ~/.bash_profile
cd ~/"Apps/SickRage"
git remote set-url origin https://donna.devices.wvvw.me/sickrage/sickrage.git
git remote set-branches --add origin master
git remote update
git fetch origin
git checkout master
git branch --set-upstream-to origin/master
git reset --hard origin/master
@anotheruiguy
anotheruiguy / node-and-express.md
Last active June 24, 2020 17:09
Set up a new Node.js project with Express >4.0: a newb's guide

And my article is deprecated!

As of just writing this, Express 4.0 was released and there are points in there that no longer matter. So, this remains as a great >4.0 article.

Node.js is the red-hot new hotness! You can't throw a stick on the internet without hitting someone talking about Node. But why? For one, it's built on JavaScript which is completely ubiquitous. So, why not build a development stack and server on JavaScript? I would argue that the installation is almost painless while the terseness of the language is not.

While you can create apps 100% from Node.js, the Express framework is a great tool that helps you solve many standard problems without having to write boilerplate code.

Node.js is here and it's not going anywhere anytime soon. So if you are new to Node.js, Express, and even JavaScript in general, this is a great newb's step-by-step guide to get started.

@vannmangel
vannmangel / Remove-SkypeAds.ps1
Last active January 14, 2021 11:54
Remove ads in skype
# start as admin!
# prompt for username
$SkypeUserName = Read-Host -Prompt "What is your Skype username?"
# stop skype-process
try{
if(Get-Process | ? {$_.Name -like 'skype'}) {Stop-Process -Name skype}
# commit changes to hosts file
$hostfile = "C:\Windows\System32\Drivers\etc\hosts"
@rmoorman
rmoorman / babelrc-vs-webpack-babel-loader-configuration.md
Created July 30, 2016 16:54
.babelrc vs webpack babel-loader configuration

Either you use .babelrc to specify environment specific settings (plugins or transforms for example) using the env key:

{
  "presets": ["es2015", "stage-0", "react"],
  "env": {
    "development": {
      "plugins": [
        ["transform-object-rest-spread"],
 ["transform-react-display-name"],
@notsobad
notsobad / api_sev.py
Last active February 5, 2022 15:29
Tornado basic auth example
# -*- coding= utf-8 -*-
import datetime
import os
import json
import tornado.ioloop
import tornado.web
import tornado
import tornado.httpclient
import traceback
import urllib2
var child_process = require('child_process'),
http = require('http');
url = require('url'),
ffmpeg = null;
var livestream = function (req, resp) {
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible).
var input = 'udp://225.1.1.1:8208';
@hongkongkiwi
hongkongkiwi / setup_unraid_ssh.sh
Created November 23, 2017 03:57
Small script to setup ssh keys and configs on Unraid to persist after boot. Supports multiple users.
#!/bin/bash
# Add this line into /boot/config/go where username is the user you want to setup, probably root
#/boot/config/ssh/setup_ssh_client.sh "username"
if [[ "$1" == "" ]]; then
echo "Invalid User!"
exit 1
fi
@ncochard
ncochard / babel-webpack.md
Last active September 29, 2023 05:15
The correct way to compile ES6 using babel...

When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:

  1. Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
  2. Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
  3. Is it going to be used as a dependency to a browser application (always bundled)?.
  • In cases 2) and 3) you want to allow for tree shaking.
  • In cases 1) and 2) you want to benefit from the "ES6"/"ES next" features supported natively by nodejs.
  • In case 3) you also want to benefit from the native support of "ES6" from your browser.
@eyecatchup
eyecatchup / hammerhead-from-lrx21o-to-lrx22c.md
Last active November 1, 2023 08:35
A step-by-step guide how to manually flash the Android 5.0.1 (LRX22C) OTA-Update on a Nexus 5 with modified system (custom recovery/kernel, rooted, modified framework etc.)..

Update: For those interested, here's the version for updating from Android 5.1.0 (LMY47D/LMY47I) to Android 5.1.1 (LMY48B):
https://gist.github.com/eyecatchup/dab5cf7977008e504213


  UPDATE `NEXUS 5` 
     SET `VERSION`='5.0.1', `BUILD`='LRX22C', `RECOVERY`='CUSTOM', `ROOTED`=1 
   WHERE `VERSION`='5.0' && `BUILD`='LRX21O' && `RECOVERY`='CUSTOM' && `ROOTED`=1 
         && `WANNA_KEEP_USERDATA`=1;