Skip to content

Instantly share code, notes, and snippets.

View sadik-fattah's full-sized avatar
🇲🇦
Working from home

sadik sadik-fattah

🇲🇦
Working from home
View GitHub Profile
@pewerner
pewerner / MSAcess.js
Created December 14, 2012 12:08
Query MS-Access Data-base from JS.
function AddRecord() {
//var adoConn = new ActiveXObject("ADODB.Connection");
var adoConn = new ActiveX("ADODB.Connection");
//var adoRS = new ActiveXObject("ADODB.Recordset");
var adoRS = new ActiveX("ADODB.Recordset");
adoConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='/\dbName.mdb'");
adoRS.Open("Select * From tblName", adoConn, 1, 3);
adoRS.AddNew;
@planetoftheweb
planetoftheweb / tweets_json.php
Created July 2, 2013 23:33
This gist will let you retrieve a series of tweets using the twitter v1.1 API. There's a few steps you have to do before you use this. 1. First, you need to go to http://dev.twitter.com/apps and create a new application. 2. You'll also need to download this library. https://github.com/themattharris/tmhOAuth (You only need the tmhOAuth.php file) …
<?php
require 'tmhOAuth.php'; // Get it from: https://github.com/themattharris/tmhOAuth
// Use the data from http://dev.twitter.com/apps to fill out this info
// notice the slight name difference in the last two items)
$connection = new tmhOAuth(array(
'consumer_key' => '',
'consumer_secret' => '',
'user_token' => '', //access token
@soyuka
soyuka / HtmlToBBCode.js
Created August 8, 2013 11:50
Html To BBCode javascript function
//Adapted from http://skeena.net/htmltobb/
var htmlToBBCode = function(html) {
html = html.replace(/<pre(.*?)>(.*?)<\/pre>/gmi, "[code]$2[/code]");
html = html.replace(/<h[1-7](.*?)>(.*?)<\/h[1-7]>/, "\n[h]$2[/h]\n");
//paragraph handling:
//- if a paragraph opens on the same line as another one closes, insert an extra blank line
@greatghoul
greatghoul / manifest.json
Last active October 20, 2023 16:48
Chrome Extension Sample - detect if an extension is installed.
{
"name": "Detect if an extension installed",
"description": "Detect if an extension installed",
"version": "0.1",
"manifest_version": 2,
"permissions": [
"management"
],
"browser_action": {
"default_popup": "popup.html"