Skip to content

Instantly share code, notes, and snippets.

View arbaaz's full-sized avatar
🔥
Building an amazing product

Arbaaz arbaaz

🔥
Building an amazing product
View GitHub Profile
@arbaaz
arbaaz / setup.sh
Last active August 9, 2018 14:17
Send message to Telegram user from a bot
#!/bin/sh
wget https://gist.githubusercontent.com/arbaaz/8d6f1317ee735cfe6d707ba72ad8848c/raw/98f2546ab980c7d738d5e3eb94cbb736aa1905ca/telegram
chmod +x telegram
mv telegram /usr/local/bin/telegram
@arbaaz
arbaaz / CRUDActions
Created July 7, 2018 07:19 — forked from prcongithub/CRUDActions
Simple Lightweight module to create no action controllers
require 'active_support'
module CRUDActions
extend ActiveSupport::Concern
included do
before_action :set_resource, only: [:show, :update, :destroy]
end
# Returns count of records matching the scope
def count
@arbaaz
arbaaz / install.sh
Created June 19, 2018 08:28 — forked from execat/install.sh
Autosetup macOS
#!/usr/bin/env bash
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until the script has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
install_thoughtbot() {
mkdir -p "$HOME/installer/logs" && cd "$HOME/installer"
@arbaaz
arbaaz / 1. main.css
Created May 25, 2018 13:34 — forked from EmranAhmed/1. main.css
CSS Responsive breakpoint, Media Query break point
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
@arbaaz
arbaaz / ramdax.js
Last active April 23, 2020 12:15
Collection of ramda extra
export const isNotEmpty = R.complement(R.isEmpty);
export const isNotNil = R.complement(R.isNil);
export const isTruthy = R.both(isNotEmpty, isNotNil);
export const findObject = R.curry((predicate, filterableObject) => {
return R.reduce(
(acc, key) => {
if (predicate(filterableObject[key])) {
return R.reduced(filterableObject[key]);
}
return acc;
https://deckofcardsapi.com/api/deck/new/shuffle/?cards=AS,2S,5C,3C,KD,AH,QH,2C,KS,8C
@arbaaz
arbaaz / ubuntu.sh
Last active October 27, 2017 13:22
unbuntu setup
sudo apt install -y git
sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
sudo apt-get install gnome-tweaks
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
@arbaaz
arbaaz / heroku.sh
Created October 8, 2017 11:35
Create php files for static files deployment
echo "{}" > composer.json
echo "<?php header( 'Location: /index.html' ) ; ?>" > index.php
@arbaaz
arbaaz / JsonDecode.elm
Created August 13, 2017 17:18
JSON decode
-- json : String
-- json =
-- """
-- {
-- "kind": "Listing",
-- "data": {
-- "children": [
-- {"data":{"url":"http://www.example.com", "title":"hello"}},
-- {"data":{"url": "http://www.example.com", "title":"world"}}
@arbaaz
arbaaz / Quora.js
Created May 29, 2017 20:08
Snippet to follow all the topics of a Quora user
Open the developer console and run this command.
document
.querySelectorAll('.topic_follow_button')
.forEach(node => !node.text.includes('Followi') && node.click())