Skip to content

Instantly share code, notes, and snippets.

View fethica's full-sized avatar
:octocat:

Fethi fethica

:octocat:
View GitHub Profile
@kharmabum
kharmabum / bluetooth-audio.m
Last active December 11, 2021 04:11
Bluetooth audio session set up
// App delegate
#import <AVFoundation/AVFoundation.h>// place in .h
// applicationDidFinishLaunchingWithOptions
// [self prepareAudioSession];
- (BOOL)prepareAudioSession {
// deactivate session
@Alex04
Alex04 / AMScanViewController.h
Last active January 4, 2023 01:46
iPhone QR Code Scanning iOS7
//
// AMScanViewController.h
//
//
// Created by Alexander Mack on 11.10.13.
// Copyright (c) 2013 ama-dev.com. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
@vishalkurup
vishalkurup / json.php
Last active December 16, 2015 05:09
PHP code to display data from our cities database in JSON format. This is the companion code to my iOS Tutorial on loading data from an external database into a table view on YouTube. Youtube channel: www.youtube.com/vtkurup/
<?php
/***************************************************************
Description: City data in JSON.
Developer: Vishal Kurup
***************************************************************/
$host = "abc12345"; //Your database host server
$db = "abc12345"; //Your database name
$user = "abc12345"; //Your database user
@fethica
fethica / JavaScript: Change a class every 2 seconds
Last active December 14, 2015 02:59
A simple jQuery function to change a class every 2 seconds.
function switchClass(){
var delay = 2000;
var colors = new Array ("red", "grey", "green", "blue");
var i = 0;
setInterval(function(){
$('span').removeClass(colors[i]);
i++;
@zhchbin
zhchbin / index.html
Created February 10, 2013 10:55
Node-Webkit API Demo: Window.capturePage
<html>
<body style="background: #333">
<script >
var gui = require('nw.gui');
var win = gui.Window.get();
function takeSnapshot() {
win.capturePage(function(img) {
var popWindow = gui.Window.open('popup.html',
{width: 420, height: 300});
popWindow.on('loaded', function() {
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 1, 2025 01:48
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@nickawalsh
nickawalsh / icons.sass
Last active October 7, 2021 09:38
Auto Hi-res Sprites
@import compass
$icons: sprite-map("icons/*.png")
$icons-hd: sprite-map("icons-hd/*.png")
i
background: $icons
display: inline-block
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)
background: $icons-hd
@djaiss
djaiss / gist:2938259
Created June 15, 2012 19:13
PHP List of countries
<?php
$countries =
array(
"AF" => "Afghanistan",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
@fgelinas
fgelinas / _lang_util.php
Created April 16, 2012 01:03
Multilanguage site utility script
<?
/* _lang_util.php - Multilanguage site utility script
* This is my basic script to detect language and keep it in a cookie
*
* Language priority, from lowest to highest :
* - default lang
* - browser accepted lang
* - cookie lang
* - query parameter lang
*
@zvineyard
zvineyard / json_class.java
Created March 10, 2012 19:56
Java: Get JSON from URL (Android)
public class Json {
public static JSONObject getJson(String url){
InputStream is = null;
String result = "";
JSONObject jsonObject = null;
// HTTP
try {