Skip to content

Instantly share code, notes, and snippets.

View mahmudinm's full-sized avatar
😺
Hi there

Mahmudin muttaqin mahmudinm

😺
Hi there
View GitHub Profile
@maxxscho
maxxscho / style.css
Created April 19, 2012 07:34
Wordpress Default CSS Styles
/* !-------- WORDPRESS CLASSES ------------------- */
/*------------------------------------------------------------ *\
\*------------------------------------------------------------ */
/* !-- WP WYSIWYG Editor Styles -- */
.entry-content img {
margin: 0 0 1.5em 0;
}
.alignleft, img.alignleft {
margin-right: 1.5em;
@taterbase
taterbase / upload.php
Created May 13, 2012 15:03
Simple file upload in php
<!DOCTYPE html>
<html>
<head>
<title>Upload your files</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>
@jasny
jasny / image-embed-html.php
Created October 23, 2012 10:40
Create base64 encoded image to embed in HTML
<?php
$files = array_slice($argv, 1);
foreach ($files as $file) {
$picture = file_get_contents($file);
$size = getimagesize($file);
// base64 encode the binary data, then break it into chunks according to RFC 2045 semantics
$base64 = chunk_split(base64_encode($picture));
$months = [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
@lukasklein
lukasklein / otp.php
Created November 4, 2012 16:01
One Time Pad PHP
<?php
function otp($text, $key) {
$text_chunks = explode(' ', $text);
$key_chunks = explode(' ', $key);
for($i = 0; $i < count($text_chunks); $i++) {
echo chr(hexdec($text_chunks[$i]) ^ hexdec($key_chunks[$i]));
}
}
otp('1C 07 7F 6F A7 86 A6 E9 E5 75 78 A9 73 B9 17 2F D6 00 25 9F B4 86 16 07 4D 07 0F 98 0F AB 0F 6C 11 10 0F 34 21 FD 2D 69 B3 0D 7F 21 96 3C', '4F 4E 3A 4F F4 C5 EE A0 A0 26 2B EC 3D 99 53 66 93 20 67 CD FD C3 50 54 0E 4F 4E DE 5B EE 41 4C 55 45 5D 77 69 DD 68 20 FD 2D 2D 6E DE 6E');
@jeffgolenski
jeffgolenski / WordPress Comment Styling SCSS
Last active October 19, 2022 14:25
SCSS WordPress Comment Styles. Based on the WordPress threaded comments CSS over at css-tricks.com, I created this nested SCSS. It's basic, simple, and clean. Quickly copy, paste, and style away! Original CSS located at: http://css-tricks.com/snippets/wordpress/base-threaded-comments-styling/
/* =========================================================
Comments
========================================================= */
ol.commentlist {
list-style:none;
margin:0 0 1em;
padding:0;
text-indent:0;
@ajtroxell
ajtroxell / contact.html
Last active February 10, 2025 17:29
Build a simple PHP, jQuery, and AJAX Powered Contact Form, from: http://ajtroxell.com/build-a-simple-php-jquery-and-ajax-powered-contact-form/
<form id="contact" name="contact" method="post">
<fieldset>
<label for="name" id="name">Name<span class="required">*</span></label>
<input type="text" name="name" id="name" size="30" value="" required/>
<label for="email" id="email">Email<span class="required">*</span></label>
<input type="text" name="email" id="email" size="30" value="" required/>
<label for="phone" id="phone">Phone</label>
<input type="text" name="phone" id="phone" size="30" value="" />
@joshbeckman
joshbeckman / animatedScrollTo.js
Created September 30, 2013 14:51
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@kostiakoval
kostiakoval / PrefUtils.java
Created March 29, 2014 15:49
SharedPreferences util
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
public class PrefUtils {
/**
* Called to save supplied value in shared preferences against given key.
* @param context Context of caller activity
@Mikodes
Mikodes / gist:be9b9ce42e46c3d4ccb6
Created November 26, 2014 10:30
All Media queries for resolutions
/* (320x480) iPhone (Original, 3G, 3GS) */
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
/* insert styles here */
}
/* (320x480) Smartphone, Portrait */
@media only screen and (device-width: 320px) and (orientation: portrait) {
/* insert styles here */
}