Skip to content

Instantly share code, notes, and snippets.

View rainb3rry's full-sized avatar
💃

rainb3rry

💃
  • Istanbul
View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active April 23, 2024 22:31
Multipart-POST Request Using Node.js

Multipart-POST Request Using Node.js

Here, I introduce 2 scripts for uploading files to Slack using Node.js as samples. These 2 sample scripts are for uploading files to Slack.

Sample script 1:

  • You can upload the zip file by converting byte array as follows.
    • At first, it builds form-data.
    • Adds the zip file converted to byte array and boundary using Buffer.concat().
    • This is used as body in request.
1 - Install Home Brew.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2 - Install aircrack-ng:
brew install aircrack-ng
3 - Install the latest Xcode, with the Command Line Tools.
//Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport//Figure out which channel you need to sniff:
@woudsma
woudsma / async-trycatch.js
Last active November 27, 2020 22:37
Recursive try/catch statements for async/await functions in a nested object (using .catch)
// Simulates try/catch statements wrapping async functions in (nested) object
// Returns copy of original object with basic promise-rejection handling for async functions using .catch
// Saves the time of writing try/catch statements in every single async function
const trycatch = obj => Object.keys(obj)
.reduce((acc, curr) => ({ ...acc, [curr]: obj[curr] instanceof Function
? (...args) => obj[curr](...args).catch(::console.error)
: trycatch(obj[curr]) }), {})
@kvlsrg
kvlsrg / get-parent-of-parent-in-sass.md
Last active January 4, 2023 09:57
Parent of parent in Sass

How to get parent of parent in Sass

You can just get it from cached &. Here is a simple BEM example:

HTML

<ul class="pagination">
  <li class="pagination__item">
    <a class="pagination__link" href="#">
      Page 1
@fernandoaleman
fernandoaleman / fix-libv8-mac.txt
Created May 5, 2016 15:14
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
@subfuzion
subfuzion / curl.md
Last active May 6, 2024 09:53
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@ankurk91
ankurk91 / git_remember_password.md
Last active October 11, 2022 04:57
Git credential cache, why type password again and again

Tired of entering password again and again ?

Run this command to remember your password:

git config --global credential.helper 'cache --timeout 28800'

Above command will tell git to cache your password for 8 hours.

@emrekgn
emrekgn / soyisimler
Created December 4, 2015 08:44
Türkçe Soyisim Listesi
ŞEN
KANDEMİR
ÇEVİK
ERKURAN
TÜTEN
ÖZTÜRK
YÜZBAŞIOĞLU
VURAL
YÜCEL
SÖNMEZ
@emrekgn
emrekgn / isimler
Last active April 26, 2024 13:14
Türkçe İsim Listesi
JALE
ALİ
MAHMUT
MANSUR KÜRŞAD
GAMZE
MİRAÇ
YÜCEL
KUBİLAY
HAYATİ
BEDRİYE MÜGE
@dtbaker
dtbaker / class.envato-api-basic.php
Last active December 21, 2020 06:15
Simple PHP class for interacting with the Envato API within a WordPress plugin
<?php
/**
* Exception handling class.
*/
class EnvatoException extends Exception {
}