Skip to content

Instantly share code, notes, and snippets.

Avatar
🤗
hello wrold

Freeman nabilfreeman

🤗
hello wrold
View GitHub Profile
View lesalon-eslint-config.js
const IGNORE = 0;
const WARN = 1;
const ERROR = 2;
module.exports = {
root: true,
"extends": "airbnb",
"parser": "babel-eslint",
"rules": {
"import/no-named-as-default-member": IGNORE,
@nabilfreeman
nabilfreeman / ccdl.command
Created Feb 15, 2021 — forked from ayyybe/ccdl.command
Adobe Offline Package Generator v0.1.2 (macOS only)
View ccdl.command
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@nabilfreeman
nabilfreeman / gist:d4af1b7be7291baec5be44aae69806d4
Last active Nov 9, 2020
How to delete things from /usr/bin
View gist:d4af1b7be7291baec5be44aae69806d4
# In macOS Catalina onwards `/usr/bin` is protected. Before you would only need to run a root shell to make any changes. Now there is something extra to do.
# Let's say I want to run this command:
# sudo rm -rf /usr/bin/python3
# Deleting something will give you the error:
# rm: /usr/bin/python3: Read-only file system
# To get around this you need to first run:
@nabilfreeman
nabilfreeman / pizzly.js
Last active Jun 29, 2020
Pizzly Node.js integration using Axios and environment variables (2 examples: Xero and Trello)
View pizzly.js
const Axios = require('axios');
const {
PIZZLY_URL,
PIZZLY_SECRET_KEY,
PIZZLY_TRELLO_ID,
PIZZLY_XERO_ID,
} = process.env;
const integrations = {
@nabilfreeman
nabilfreeman / copyToFat32.sh
Last active Jun 1, 2021
FAT32 File copier & splitter (works with Multiman)
View copyToFat32.sh
#!/bin/bash
# Are you using Mac OS X?
# You need to install coreutils for this to work.
# try `brew install coreutils`
# or `sudo port install coreutils`
# set a part size that works with FAT32 drives
PART_SIZE=3999
# nice little intro
@nabilfreeman
nabilfreeman / copyToFat32.sh
Created Nov 8, 2018
FAT32 File copier & splitter (works with Multiman)
View copyToFat32.sh
#!/bin/bash
# Are you using Mac OS X?
# You probably need to install a newer version of split for this to work.
# try `brew install coreutils`
# or `sudo port install coreutils`
# set a part size that works with FAT32 drives
PART_SIZE=3999
# nice little intro
@nabilfreeman
nabilfreeman / copyToFat32.sh
Created Nov 8, 2018
FAT32 File copier & splitter (works with Multiman)
View copyToFat32.sh
#!/bin/bash
# Are you using Mac OS X?
# You probably need to install a newer version of split for this to work.
# try `brew install coreutils`
# or `sudo port install coreutils`
# set a part size that works with FAT32 drives
PART_SIZE=3999
# nice little intro
@nabilfreeman
nabilfreeman / shadowsocks-relay-haproxy.cfg
Last active Jun 29, 2021
HAProxy Shadowsocks relay example. You can run this on a server in China with good peering, and then proxy traffic to your outside server. Speed will be better (and improved obfuscation).
View shadowsocks-relay-haproxy.cfg
# 1. Install haproxy on Ubuntu.
# 2. Edit file path: /etc/haproxy/haproxy.cfg
# 3. Run with: haproxy -f /etc/haproxy/haproxy.cfg
# 4. haproxy will run in the background, so you can disconnect safely.
# 5. Point your Shadowsocks client at <CHINA IP>:8001 (or 8002, etc.) - you will actually be connected to your interational server!
global
ulimit-n 51200
defaults
@nabilfreeman
nabilfreeman / lambda-redirect-to-trailing-slash.js
Created Nov 20, 2017
Redirect to trailing slashes on CloudFront with AWS Lambda. (all this because S3 uses 302 redirects instead of 301)
View lambda-redirect-to-trailing-slash.js
'use strict';
const path = require('path')
exports.handler = (event, context, callback) => {
//get request object
const { request } = event.Records[0].cf
const url = request.uri;
@nabilfreeman
nabilfreeman / restart-codeship-lambda.js
Last active Nov 9, 2017
Restart Codeship build from AWS Lambda
View restart-codeship-lambda.js
const https = require('https');
const { CODESHIP_KEY, PROJECT_ID } = process.env;
const getBuilds = () => {
console.time('Fetching builds...');
return new Promise((resolve, reject) => {
const host = 'codeship.com';
const path = `/api/v1/projects/${PROJECT_ID}.json?api_key=${CODESHIP_KEY}`;
const options = {