Skip to content

Instantly share code, notes, and snippets.

View Slinjez's full-sized avatar
🌴
On vacation

Mwangi Thiga Slinjez

🌴
On vacation
View GitHub Profile
@zvineyard
zvineyard / html_form
Created August 30, 2012 15:29
PHP: Upload and Rename File
<form action="" enctype="multipart/form-data" method="post">
<input id="file" name="file" type="file" />
<input id="Submit" name="submit" type="submit" value="Submit" />
</form>
@jameshibbard
jameshibbard / gist:4147409
Created November 26, 2012 09:39
A simple visitor counter
<?php
session_start();
$counter_name = "counter.txt";
// Check if a text file exists. If not create one and initialize it to zero.
if (!file_exists($counter_name)) {
$f = fopen($counter_name, "w");
fwrite($f,"0");
fclose($f);
}
@parth1020
parth1020 / Google Maps Simple Multiple Marker Example
Created January 8, 2013 07:04
Google Maps Simple Multiple Marker Example
<html>
<head>
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</head>
<body>
<div id="map" style="height: 400px; width: 500px;">
</div>
<script type="text/javascript">
@paulirish
paulirish / what-forces-layout.md
Last active July 4, 2024 22:13
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@CodeMyUI
CodeMyUI / index.html
Created September 12, 2016 14:09
Pokemon Slider
<div class="slider__warpper">
<div class="flex__container flex--pikachu flex--active" data-slide="1">
<div class="flex__item flex__item--left">
<div class="flex__content">
<p class="text--sub">Pokemon Gen I</p>
<h1 class="text--big">Pikachu</h1>
<p class="text--normal">Pikachu is an Electric-type Pokémon introduced in Generation I. Pikachu are small, chubby, and incredibly cute mouse-like Pokémon. They are almost completely covered by yellow fur.</p>
</div>
<p class="text__background">Pikachu</p>
</div>
@Slinjez
Slinjez / Google Maps Simple Multiple Marker Example
Last active July 19, 2017 13:29 — forked from parth1020/Google Maps Simple Multiple Marker Example
Google Maps Simple Multiple Marker Example
<!-- Edits by Mwangi Thiga-->
<html>
<head>
<title>Google Maps Multiple Markers</title>
<!--The 'sensor' thing could cause issues, so, -->
<!-- <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>-->
<script src="http://maps.google.com/maps/api/js?key=your api key" type="text/javascript"></script>
<!-- For more on api keys, pay this guy a visit: https://developers.google.com/maps/documentation/javascript/get-api-key -->
</head>
@ann-mukundi
ann-mukundi / Intro to Git
Created January 23, 2018 13:19
Cp-readiness
Exercise 1
Install Git on their computer
Create a folder called cp-readiness on your local computer
Navigate to the folder and initialize it with git.
Create a file called README.md with a short a short intro of who you are to this folder
Check the status of your repo
Add the file README.md to the staging area
Commit with the message Initial Commit
@ann-mukundi
ann-mukundi / Working with branches
Created January 23, 2018 13:26
CP-readiness: git branches
Create a github account here
Create a new repository on github with the name cp-readiness
Follow the instructions to push an existing repository from the command line
In your local machine, create a branch called recipes
Switch to the new branch
In a folder called recipe, create a file called tea.txt
Add the changes to staging
Push to the recipes branch