Skip to content

Instantly share code, notes, and snippets.

View ArchTaqi's full-sized avatar
🏠
Working from home

Muhammad Taqi ArchTaqi

🏠
Working from home
View GitHub Profile
@rrosiek
rrosiek / install_mysql.sh
Last active February 28, 2025 18:55
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Tested with Ubuntu 16.04.
#! /usr/bin/env bash
###
#
# install_mysql.sh
#
# This script assumes your Vagrantfile has been configured to map the root of
# your application to /vagrant and that your web root is the "public" folder
# (Laravel standard). Standard and error output is sent to
# /vagrant/vm_build.log during provisioning.
#------------------------------------------------------------------------------
# Make things VirtualEnv aware (Windows version).
# More info: http://www.swegler.com/becky/blog/2011/08/28/python-django-mysql-on-windows-7-part-3-ipython-virtual-environments/
# add this to the end of ipython_config
# (or course, for virtualenvs created via --no-site-packages, it would
# be much easier just to install iPython)
#------------------------------------------------------------------------------
import sys
import site
from os import environ
@henriquemoody
henriquemoody / http-status-codes.php
Last active March 7, 2025 15:17
List of HTTP status codes in PHP
<?php
/**
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
*
* You may also want a list of unofficial codes:
*
* 103 => 'Checkpoint',
* 218 => 'This is fine', // Apache Web Server
* 419 => 'Page Expired', // Laravel Framework
@archeg
archeg / gist:5652752
Created May 26, 2013 13:14
Example of working with notes on Google Spreadsheet
__author__ = 'archeg'
import httplib
import urllib
import urllib2
import re
def URLRequest(url, params, headers, method="GET"):
if method == "POST":
@grevory
grevory / html5-starter.html
Last active July 8, 2024 21:47
HTML5 Starter Template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 Starter Template</title>
<meta name="description" content="Starter Template">
<meta name="author" content="Gregry Pike">
<link rel="stylesheet" href="css/styles.css?v=1.0">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
@damilare
damilare / cleanup.py
Last active April 3, 2020 00:17
Tweeting is like real world conversations. People don't usually record what they say, so it might be a good idea to clean-up your tweets every now and then.
""" 1) Download python twitter library from https://github.com/sixohsix/twitter
2) Go to dev.twitter.com creaate an application and genenrate tokens
3) Setup your tokens below
4) python cleanup.py and your tweets are gone!
"""
from twitter import *
t = Twitter(
auth=OAuth('--your-access-token-here',
@rampicos
rampicos / social.js
Last active January 10, 2019 10:10
Social.js is the Appcelerator Titanium's Alloy Widget at first it is used to connect with Twitter only, though twitter and linkedin uses OAuth for its authentication I made some changes on Social.js for multi-purpose to connect Twitter and LinkedIn
function hex_sha1(s) {
return binb2hex(core_sha1(str2binb(s), s.length * chrsz));
}
function b64_sha1(s) {
return binb2b64(core_sha1(str2binb(s), s.length * chrsz));
}
function str_sha1(s) {
return binb2str(core_sha1(str2binb(s), s.length * chrsz));
@craigmarvelley
craigmarvelley / IsAdminFieldSubscriber.php
Created November 10, 2012 13:17
Symfony2 Form Event Subscriber Example
<?php
namespace Acme\Bundle\AppBundle\Form\EventListener;
use Symfony\Component\Form\Event\DataEvent;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvents;
class IsAdminFieldSubscriber implements EventSubscriberInterface
@awidegreen
awidegreen / vim_cheatsheet.md
Last active April 10, 2025 20:01
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
$sudo chmod 777 /etc/apt/sources.list
$sudo echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list
$sudo apt-get update
$sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
$sudo apt-get update