Skip to content

Instantly share code, notes, and snippets.

View itsazzad's full-sized avatar
🎯
Focusing

Sazzad Hossain (Tushar) Khan itsazzad

🎯
Focusing
View GitHub Profile
@bdotdub
bdotdub / redis.markdown
Created November 24, 2010 22:18
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

@mhawksey
mhawksey / gist:1276293
Last active October 23, 2023 09:00
Google App Script to insert data to a google spreadsheet via POST or GET - updated version as per https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
-- phpMyAdmin SQL Dump
-- version 3.3.8.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 28, 2012 at 04:56 PM
-- Server version: 5.0.91
-- PHP Version: 5.3.6-pl0-gentoo
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@jkrems
jkrems / Vagrantfile
Created July 27, 2012 08:03
Simple vagrant setup with debian and puppet
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# Map NFS uid/gid to current user. This can be used to create a
# user inside the VM with matching uid/gid which makes file access
# a lot easier.
config.nfs.map_uid = Process.uid
config.nfs.map_gid = Process.gid
@martinaglv
martinaglv / 01.js
Last active May 10, 2019 07:03
What do these functions do?
function whatDoesItDo(val){
return val ? 1 : 2;
}
@omarstreak
omarstreak / background.js
Last active October 22, 2023 15:44
Chrome API Extension
//oauth2 auth
chrome.identity.getAuthToken(
{'interactive': true},
function(){
//load Google's javascript client libraries
window.gapi_onload = authorize;
loadScript('https://apis.google.com/js/client.js');
}
);
@RuGa
RuGa / massInsertOrUpdate.php
Last active June 3, 2024 15:50
Mass (bulk) insert or update on duplicate for Laravel 4/5
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
@Iman
Iman / clean.sh
Last active July 22, 2024 18:04
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@shaheemirza
shaheemirza / ElasticSearchInstall.sh
Last active January 21, 2018 02:56
Shell Script to install ElasticSearch on Ubuntu Server
### ElasticSearch version
if [ -z "$1" ]; then
echo ""
echo " Please specify the Elasticsearch version you want to install!"
echo ""
echo " $ $0 1.7.1"
echo ""
exit 1
fi
@wsakaren
wsakaren / gist:3a26a61347cbe485677f
Created September 2, 2015 05:41
Mage::getStoreConfig in Magento 2 compared to Magento 1
Magento 1.x:
Mage::getStoreConfig('carriers/shipper/active')
Magento 2.x:
protected $scopeConfig;
public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig