Skip to content

Instantly share code, notes, and snippets.

View Idnan's full-sized avatar
👋

Adnan Ahmed Idnan

👋
View GitHub Profile
@Idnan
Idnan / check_my_followers_stats.js
Created August 29, 2021 16:52 — forked from zwithz/check_my_followers_stats.js
A widget to visually show all my social media's followers stats by @scriptable. For more details -> https://twitter.com/zwithz1998/status/1296834411300716544
// Use @substats, a open source repo on @Github, to fetch all my social medias' stats
const url = "https://api.spencerwoo.com/substats/?source=weibo&queryKey=2028434647&source=twitter&queryKey=zwithz1998&source=jikeFollower&queryKey=e1377acb-40ed-495e-9a73-158273b4090a"
const req = new Request(url)
const json = await req.loadJSON()
const data = json.data.subsInEachSource
// Twitter
const twitterFollowers = data.twitter
@Idnan
Idnan / get_latest_release.sh
Created January 6, 2020 06:52 — forked from lukechilds/get_latest_release.sh
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
To use in react-native, choose from font below, and then add to style element:
<Text style={{ fontFamily: 'Arial' }}>Arial Font</Text>
Alternatively, add your own custom font face
Android:
========
normal
@Idnan
Idnan / simple-pagination.js
Created November 21, 2019 21:29 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@Idnan
Idnan / gist:10bf7741cd882e31aea23d40091ed417
Created October 8, 2019 15:46 — forked from rollxx/gist:2689219
iStat trial reset
rm ~/Library/Preferences/com.bjango.istatmenus.plist
@Idnan
Idnan / HOWTO.md
Created April 4, 2018 07:42 — forked from cvan/HOWTO.md
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@Idnan
Idnan / sublime-command-line.md
Created February 27, 2018 13:38 — forked from adrianorsouza/sublime-command-line.md
launch sublime text from the command line

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

@Idnan
Idnan / iterm2-solarized.md
Created February 22, 2018 07:34 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@Idnan
Idnan / new_user.sh
Created August 14, 2017 13:50 — forked from meabed/new_user.sh
OVH Ubuntu Kernel
#!/bin/bash
#
# #############################################################################
# Create new SSH user (Ubuntu)
# 1) Download the "raw" with - wget -O createNewSSHUser.sh
# 2) Make it executable with - chmod a+x createNewSSHUser.sh
# 5) Immediately set a new password by logging in once with -
# su newUsrName
# #############################################################################
#
@Idnan
Idnan / guzzle-custom-curlfactory.php
Created August 23, 2016 13:13 — forked from puckbag/guzzle-custom-curlfactory.php
Custom Guzzle CurlFactory
<?php
require __DIR__ . '/vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Handler\CurlFactory;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\Handler\CurlMultiHandler;
use GuzzleHttp\Handler\EasyHandle;