Skip to content

Instantly share code, notes, and snippets.

View hrehman200's full-sized avatar
🏠
Always working from home

Haris ur Rehman hrehman200

🏠
Always working from home
  • Softcode
  • Kohat, KPK, Pakistan
View GitHub Profile
Qualtrics.SurveyEngine.addOnload(function()
{
Qualtrics.SurveyEngine.setEmbeddedData('money', 10)
});
Qualtrics.SurveyEngine.addOnReady(function()
{
function generateRandomNumber(boxDiv, mean, sd) {
const randomNumber = generateRandomNormal(mean, sd);
const roundedNumber = Math.round(randomNumber * 100) / 100;
@hrehman200
hrehman200 / Dashboard.php
Created September 19, 2023 16:28
Dashboard controller for a CodeIgniter Google Ads related project
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Dashboard extends CI_Controller
{
public function __construct()
{
parent::__construct();
}
@hrehman200
hrehman200 / index.html
Created April 6, 2022 20:01
A UI Enhancement for a Survey in Alchemer
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="/docs/4.0/assets/img/favicons/favicon.ico">
<title>Fixed top navbar example for Bootstrap</title>
from random import shuffle
from os.path import isfile, join
from os import listdir
import os
import tweepy
import time
auth = tweepy.OAuthHandler('xxx', 'xxx')
auth.set_access_token('xxx', 'xxx')
@hrehman200
hrehman200 / mount_4tb.sh
Created February 26, 2018 19:31
Steps to mount large size (>2 TB) GPT formatted external hard drive on Linux
# Following command should list the 4 TB external hard drive. At the bottom you will see external hdd info and after that /dev/sdc or something like that:
sfdisk -l
# We need to create one partition of 4 TB so that it can be mounted. For this we need parted command with our external hdd parameter:
parted /dev/sdc
# you will enter into parted app. Enter mklabel to rewrite partition table of external drive i.e. /dev/sdc
(parted) mklabel gpt
# set unit to TB
@hrehman200
hrehman200 / gist:887f3f9938f386b33bae63d53e282e87
Last active November 10, 2016 08:15
Flattens an arbitrary nested arrays of integers
/**
* Flattens an arbitrary nested arrays of integers
* e.g. [[1,2,[3]],4] -> [1,2,3,4]
*
* @param arr The input array
* @param responseArr The output array we will be filling via recursion
* @returns {Array} The flattened array
*/
function flattenArray(arr, responseArr) {