Skip to content

Instantly share code, notes, and snippets.

View dehamzah's full-sized avatar
🦉
Morning Owl

Dede Hamzah dehamzah

🦉
Morning Owl
View GitHub Profile
@dehamzah
dehamzah / accordion.js
Created November 9, 2017 00:37
accordion
<script>
$('.js-accordion__toggle').click(function(e) {
e.preventDefault();
var $this = $(this);
if ($this.next().hasClass('show')) {
$this.removeClass('active');
$this.next().removeClass('show');
$this.next().slideUp(350);
} else {
#!/bin/bash
echo "Hello" "$@"
@dehamzah
dehamzah / README-Template.md
Created April 5, 2017 07:28 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@dehamzah
dehamzah / generate.js
Last active April 14, 2024 16:47
Generate secret key in NodeJS
require('crypto').randomBytes(48, function(err, buffer) { var token = buffer.toString('hex'); console.log(token); });
@dehamzah
dehamzah / content.md
Last active March 10, 2017 23:35
[Find files in this directory]
@dehamzah
dehamzah / README.md
Created February 20, 2017 23:54 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@dehamzah
dehamzah / install-redis.sh
Last active February 13, 2017 05:03 — forked from clzola/install-redis.sh
Bash script for installing Redis on Ubuntu 16.04
#!/bin/bash
# Install the Build and Test Dependencies
apt-get update
apt-get install -y curl build-essential tcl
# Download and Extract the Source Code
cd /tmp
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
@dehamzah
dehamzah / .bashrc
Created February 7, 2017 03:58
Add this to your .bashrc / .zshrc to automatically set node version that set in .nvmrc when changing directory
# Automatically switch to node version that set in .nvmrc
# if we change directory to that folder
cd() {
builtin cd "$@"
if [ -e ./.nvmrc ];then
{
nvm use
} &> /dev/null
fi
}
@dehamzah
dehamzah / generate_api_key.sh
Created January 18, 2017 02:41
credits: Samuel Marks @samuel at openedx slack
python -c 'from uuid import uuid4; print uuid4().get_hex()'
<html>
<head>
<title>API Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var accessToken = "e858a1d1dec34a619b336676743d15e5";
var baseUrl = "https://api.api.ai/v1/";
var synth;