Skip to content

Instantly share code, notes, and snippets.

View omt66's full-sized avatar
🙂

Ogun omt66

🙂
View GitHub Profile
@omt66
omt66 / 0_reuse_code.js
Last active September 17, 2015 08:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
anonymous
anonymous / index.html
Created September 14, 2015 02:38
misc iframe and div positioning
<html>
<head>
<title>Test by O</title>
<style>
body {
margin: 0;
padding: 0;
}
.f1 {
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active June 1, 2024 09:44
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@nmerouze
nmerouze / main.go
Last active March 2, 2022 16:36
JSON-API with Go and MongoDB: Final Part
package main
import (
"encoding/json"
"log"
"net/http"
"reflect"
"time"
"github.com/gorilla/context"
@sararob
sararob / data-structure.js
Last active April 26, 2022 22:21
Role-based security in Firebase
/*
This example shows how you can use your data structure as a basis for
your Firebase security rules to implement role-based security. We store
each user by their Twitter uid, and use the following simplistic approach
for user roles:
0 - GUEST
10 - USER
20 - MODERATOR
@iamkirkbater
iamkirkbater / autoSizr.js
Created August 6, 2014 13:45
Simple jQuery Plugin that auto resizes text to fill a specific sized div (great for responsive slideshows that utilize large banner text with variable lengths), derived from https://gist.github.com/iam4x/5015270
$.fn.autoSizr = function () {
var el, elements, _i, _len, _results;
elements = $(this);
if (elements.length < 0) {
return;
}
_results = [];
for (_i = 0, _len = elements.length; _i < _len; _i++) {
el = elements[_i];
_results.push((function(el) {
@derekconjar
derekconjar / wordpress-firebase.php
Last active April 25, 2024 15:21
An example of using Firebase and WordPress together. The idea is to use WP's custom post types and metaboxes to make content management easy, and sync with Firebase so that your websites have access to a real-time JSON feed of your custom data.
<?php
/**
* All custom functions should be defined in this class
* and tied to WP hooks/filters w/in the constructor method
*/
class Custom_Functions {
// Custom metaboxes and fields configuration
(function() {
// Do not use this library. This is just a fun example to prove a
// point.
var Bloop = window.Bloop = {};
var mountId = 0;
function newMountId() {
return mountId++;
}
@ccabanero
ccabanero / Android - using LocationListener with Google Maps v2
Last active April 7, 2022 13:57
Android - using LocationListener with Google Maps v2
import com.google.android.gms.maps.CameraUpdate;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.GoogleMap.OnMapClickListener;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import android.app.Activity;
import android.content.Context;
@burakerdem
burakerdem / turkey_cities_counties.sql
Created July 22, 2013 14:04
City and county list in Turkey with lat/lng.
DROP TABLE IF EXISTS `cities`;
CREATE TABLE `cities` (
`id` int(2) NOT NULL,
`title` varchar(255) NOT NULL,
`lat` double(11,8) DEFAULT NULL,
`lng` double(11,8) DEFAULT NULL,
`northeast_lat` double(11,8) DEFAULT NULL,
`northeast_lng` double(11,8) DEFAULT NULL,
`southwest_lat` double(11,8) DEFAULT NULL,
`southwest_lng` double(11,8) DEFAULT NULL,