Skip to content

Instantly share code, notes, and snippets.

View AnasAboreeda's full-sized avatar
📚
learning one thing about everything and learning everything about one thing

Anas Aboreeda AnasAboreeda

📚
learning one thing about everything and learning everything about one thing
View GitHub Profile
@AnasAboreeda
AnasAboreeda / reverse-a-string.js
Last active November 13, 2016 15:27
Reverse a String
// Bonfire: Reverse a String
// Author: @anasfullstack
// Challenge: http://www.freecodecamp.com/challenges/bonfire-reverse-a-string
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function reverseString(str) {
return str.split('').reverse().join('');
}
reverseString("hello");
@AnasAboreeda
AnasAboreeda / factorialize-a-number.js
Last active November 13, 2016 15:27
Factorialize a Number
// Bonfire: Factorialize a Number
// Author: @anasfullstack
// Challenge: http://www.freecodecamp.com/challenges/bonfire-factorialize-a-number
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function factorialize(num) {
var factorial = 1;
if (num > 1){
@AnasAboreeda
AnasAboreeda / redis-autostart-osx.md
Created January 29, 2016 15:43 — forked from subfuzion/redis-autostart-osx.md
redis auto start OS X

Install with Homebrew

brew install redis

Set up launchctl to auto start redis

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)

@AnasAboreeda
AnasAboreeda / NodeJs Tools.md
Created April 19, 2016 15:17
NodeJs Development Tools
@AnasAboreeda
AnasAboreeda / Generate self signed no pass open ssl certificates.md
Last active November 13, 2016 16:18
Generate self signed no pass open ssl certificates

Here is a simplified version that removes the passphrase, ups the security to suppress warnings and includes a suggestion in comments to pass in -subj to remove the full question list:

   $ openssl genrsa -des3 -out server.key 2048
   $ openssl rsa -in server.key -out server.key
   $ openssl req -sha256 -new -key server.key -out server.csr -subj '/CN=localhost'
   $ openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt

Replace 'localhost' with whatever domain you require. You will need to run the first two commands one by one as openssl will prompt for a passphrase.

@AnasAboreeda
AnasAboreeda / byteify.py
Created November 14, 2016 08:52
Parse Json
def byteify(input):
if isinstance(input, dict):
return {byteify(key): byteify(value)
for key, value in input.iteritems()}
elif isinstance(input, list):
return [byteify(element) for element in input]
elif isinstance(input, unicode):
return input.encode('utf-8')
else:
return input
@AnasAboreeda
AnasAboreeda / uncommitLastCommit.md
Created November 14, 2016 08:58 — forked from alexislucena/uncommitLastCommit.md
Git: How to uncommit my last commit in git

To keep the changes from the commit you want to undo

$ git reset --soft HEAD^

To destroy the changes from the commit you want to undo

$ git reset --hard HEAD^

You can also say

@AnasAboreeda
AnasAboreeda / uid_generator.js
Created November 14, 2016 10:49
create a unique identifier with the given `len`
/**
* Return a unique identifier with the given `len`.
*
* utils.uid(10);
* // => "FDaS435D2z"
*
* @param {Number} len
* @return {String}
* @api private
*/
// Atom settings
@AnasAboreeda
AnasAboreeda / cloudSettings
Last active January 25, 2021 12:42
Code settings
{"lastUpload":"2021-01-25T12:41:54.588Z","extensionVersion":"v3.4.3"}