Skip to content

Instantly share code, notes, and snippets.

View HazemNoor's full-sized avatar

Hazem Noor HazemNoor

View GitHub Profile
@skyrepprac
skyrepprac / gist:fe781b30e53f5e2aca99ff7e65013c37
Created July 12, 2017 06:16
Magento - Add Bundle Product Programmatically
<?php
require_once('includes/config.php');
require_once('app/Mage.php');
$storeID = 1;
$websiteIDs = array(1);
$cats = array(5);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
function wpex_minify_css( $css ) {
// Normalize whitespace
$css = preg_replace( '/\s+/', ' ', $css );
// Remove ; before }
$css = preg_replace( '/;(?=\s*})/', '', $css );
// Remove space after , : ; { } */ >
$css = preg_replace( '/(,|:|;|\{|}|\*\/|>) /', '$1', $css );
<html>
<body>
<canvas width="800" height="800" id="c" />
<script type="text/javascript">
function doit(){
package main
import "golang.org/x/tour/pic"
func Pic(dx, dy int) [][]uint8 {
ret := make([][]uint8, dy)
for y := 0; y < dy; y++ {
row := make([]uint8, dx)
for x := 0; x < dx; x++ {
row[x] = uint8(y)
@lizrice
lizrice / main.go
Created August 25, 2016 10:02
Container from scratch
package main
// @lizrice, mostly copied from @doctor_julz: https://gist.github.com/julz/c0017fa7a40de0543001
import (
"fmt"
"os"
"os/exec"
"syscall"
)
@oxguy3
oxguy3 / deploy.php
Last active April 16, 2025 07:58
Script used to automatically deploy from GitHub to a cPanel shared hosting server
<?php
/**
* deploy.php by Hayden Schiff (oxguy3)
* Available at https://gist.github.com/oxguy3/70ea582d951d4b0f78edec282a2bebf9
*
* No rights reserved. Dedicated to public domain via CC0 1.0 Universal.
* See https://creativecommons.org/publicdomain/zero/1.0/ for terms.
*/
// random string of characters; must match the "Secret" defined in your GitHub webhook
@munim
munim / youtube-dl-download-pluralsight.md
Last active July 28, 2022 21:19
youtube-dl to download pluralsight videos

Download Plural Sight videos

Software required:

youtube-dl

After installation and putting the youtube-dl in PATH

youtube-dl \
@mhubig
mhubig / Dockerfile
Last active October 31, 2024 16:30
Alpine Linux based cronjob runner
FROM alpine:latest
RUN apk add --update php python py-pip mysql-client \
&& pip install awscli \
&& rm -rf /var/cache/apk/*
RUN touch crontab.tmp \
&& echo '* */6 * * * /usr/bin/php /var/www/partkeepr/app/console partkeepr:cron:run' > crontab.tmp \
&& echo '0 2 * * * /usr/bin/sql_backup' >> crontab.tmp \
&& crontab crontab.tmp \
@vasanthk
vasanthk / System Design.md
Last active April 19, 2025 20:36
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {