Skip to content

Instantly share code, notes, and snippets.

View HusseinElMotayam's full-sized avatar

Hussein El Motayam HusseinElMotayam

View GitHub Profile
@michael-simons
michael-simons / TransactionandcustomsessionApplication.java
Created August 28, 2018 10:32
Use Spring Data Neo4js injectable OGM Session
package soquestions.transactionandcustomsession;
import java.util.Map;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.session.Session;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.neo4j.annotation.Query;
@eolant
eolant / Confirm.vue
Last active March 23, 2024 08:48
Vuetify Confirm Dialog component that can be used locally or globally
<template>
<v-dialog v-model="dialog" :max-width="options.width" :style="{ zIndex: options.zIndex }" @keydown.esc="cancel">
<v-card>
<v-toolbar dark :color="options.color" dense flat>
<v-toolbar-title class="white--text">{{ title }}</v-toolbar-title>
</v-toolbar>
<v-card-text v-show="!!message" class="pa-4">{{ message }}</v-card-text>
<v-card-actions class="pt-0">
<v-spacer></v-spacer>
<v-btn color="primary darken-1" text @click.native="agree">Yes</v-btn>
@angstbear
angstbear / fish_greeting.fish
Last active January 30, 2023 02:48
fortune + cowsay (random animal) + lolcat Fish-Shell prompt greeting
function fish_greeting
if not which fortune > /dev/null ^ /dev/null
switch (uname)
case Darwin
echo Installing fortune and cowsay
brew install fortune
sudo gem install lolcat
case Linux
echo Installing fortune and cowsay
if which apt-get > /dev/null ^ /dev/null
@emad-elsaid
emad-elsaid / readability.rb
Created July 25, 2014 23:20
import links content to facebook comments by mentioning this bot, you'll need to run it periodically using cronjob
#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
# **Usage** :
#
# * `ruby readability.rb <accesstoken>`
# this will get a long term access token from the short term one
# you can create a facebook app and get access token from here
# * `ruby readability.rb`
# will start the script
require 'open-uri'
@rubo77
rubo77 / rotate-screen.sh
Last active October 9, 2023 11:30
This script rotates the screen and touchscreen input, disables or enbles the touchpad, and dis- or enables the virtual keyboard on a Lenovo Yoga 13 or Yoga 2 Pro (source: http://askubuntu.com/q/405628/34298)
#!/bin/bash
# This script rotates the screen and touchscreen input 90 degrees each time it is called,
# also disables the touchpad, and enables the virtual keyboard accordingly
# by Ruben Barkow: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen and Touchpad device with `xinput`
TouchscreenDevice='ELAN Touchscreen'
TouchpadDevice='SynPS/2 Synaptics TouchPad'
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 23, 2024 12:17
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@KonradIT
KonradIT / readme.md
Last active September 25, 2023 01:55
GoPro Studio for Linux
@kra3
kra3 / eq.preset
Created March 26, 2014 12:11
Audacious presets: ~/.config/audacious/eq.preset
[Presets]
Preset0=Classical
Preset1=Club
Preset2=Dance
Preset3=Flat
Preset4=Live
Preset5=Laptop Speakers/Headphone
Preset6=Rock
Preset7=Pop
@edelpero
edelpero / heroku_rails_phantomjs.md
Last active May 10, 2021 08:31
Heroku, Ruby on Rails and PhantomJS

#Heroku, Ruby on Rails and PhantomJS

In this post, I’m going to show you how to modify an existing Ruby on Rails app running on Heroku’s Cedar stack to use PhantomJS for screen scraping. If you’ve never heard of PhantomJS, it’s a command-line WebKit-based browser (that supports JavaScript, cookies, etc.).

Let’s get started. This is a high-level overview of the required steps:

  • Modify your app to use multiple Heroku buildpacks.
  • Extend your app to use both the Ruby as well as the PhantomJS buildpacks.
  • Confirm that everything worked.
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)