Skip to content

Instantly share code, notes, and snippets.

View Clivern's full-sized avatar

Ahmed Clivern

View GitHub Profile

Ubuntu 22.04 for Deep Learning

In the name of God

This gist contains steps to setup Ubuntu 22.04 for deep learning.


Install Ubuntu 22.04

@Clivern
Clivern / RAILS_CHEATSHEET.md
Created October 23, 2021 10:40 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@Clivern
Clivern / jq-cheetsheet.md
Created October 20, 2021 09:48 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@Clivern
Clivern / github-api-create-pull-request-end-to-end.py
Created April 26, 2021 22:44 — forked from nottrobin/github-api-create-pull-request-end-to-end.py
With Github API v3, create branch, commit a change to a file and open a pull request
#! /usr/bin/env python
from base64 import b64decode
from github import Github
with open('access-token.txt') as token_file:
token = token_file.read().strip()
api = Github(token)
site = api.get_repo('nottrobin/gh-cms-example-site')
@Clivern
Clivern / gist:575d355ccdd16178ca1b9fa66e677790
Created December 17, 2020 23:15 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@Clivern
Clivern / revert-a-commit.md
Created December 2, 2020 22:50 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@Clivern
Clivern / WordCounter.scala
Created November 4, 2019 22:06 — forked from Diego81/WordCounter.scala
Simple Word Counter implemented using Akka
import akka.actor.{ Actor, ActorRef, Props, ActorSystem }
case class ProcessStringMsg(string: String)
case class StringProcessedMsg(words: Integer)
class StringCounterActor extends Actor {
def receive = {
case ProcessStringMsg(string) => {
val wordsInLine = string.split(" ").length
sender ! StringProcessedMsg(wordsInLine)
@Clivern
Clivern / Dockerfile
Created August 8, 2019 18:38 — forked from thesandlord/Dockerfile
ConfigMaps and Secrets with Kubernetes
# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
FROM node:6-onbuild
EXPOSE 3000
ENV LANGUAGE English
ENV API_KEY 123-456-789
@Clivern
Clivern / introrx.md
Created July 25, 2019 22:07 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@Clivern
Clivern / SlackLauncher.sh
Created July 16, 2019 08:51 — forked from viktorklang/SlackLauncher.sh
Launcher script for Slack on macOS which warns you if you open if while on battery power
#!/usr/bin/env bash
if [[ $(pmset -g ps | head -1) =~ "Battery Power" ]]; then
osascript -e 'display notification "You are starting Slack while running on battery power" with title "Battery Drain Source Detected" subtitle ""'
fi
open /Applications/Slack.app